Exemplo n.º 1
0
        /// <summary>
        /// Transforms a <see cref="M3__x4t__"/> to a <see cref="M3__x3t__"/> by deleting the
        /// specified row and column. Internally the <see cref="M3__x4t__"/> is tarnsformed
        /// to a <see cref="M4__x4t__"/> to delete the row and column.
        /// </summary>
        /// <param name="deleted_row">Row to delete.</param>
        /// <param name="deleted_column">Column to delete.</param>
        /// <returns>A <see cref="M3__x3t__"/>.</returns>
        public M3__x3t__ Minor(int deleted_row, int deleted_column)
        {
            M4__x4t__ temp = (M4__x4t__)this;

            M3__x3t__ result      = new M3__x3t__();
            int       checked_row = 0;

            for (int actual_row = 0; actual_row < 4; actual_row++)
            {
                int checked_column = 0;

                if (actual_row != deleted_row)
                {
                    for (int actual_column = 0; actual_column < 4; actual_column++)
                    {
                        if (actual_column != deleted_column)
                        {
                            result[checked_row, checked_column] = temp[actual_row, actual_column];
                            checked_column++;
                        }
                    }
                    checked_row++;
                }
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Multiplacation of a <see cref="Scale__x3t__"/> with a <see cref="M3__x3t__"/>.
        /// </summary>
        public static M3__x3t__ Multiply(Scale__x3t__ scale, M3__x3t__ mat)
        {
            return(new M3__x3t__(scale.X * mat.M00,
                                 scale.X * mat.M01,
                                 scale.X * mat.M02,

                                 scale.Y * mat.M10,
                                 scale.Y * mat.M11,
                                 scale.Y * mat.M12,

                                 scale.Z * mat.M20,
                                 scale.Z * mat.M21,
                                 scale.Z * mat.M22));
        }
Exemplo n.º 3
0
        /// <summary>
        /// A <see cref="M4__x4t__"/> is transformed to <see cref="M3__x3t__"/> by deleting specified row and column
        /// </summary>

        public M3__x3t__ Minor(int rowToDelete, int columnToDelete)
        {
            M3__x3t__ result      = new M3__x3t__();
            int       checked_row = 0;

            for (int actual_row = 0; actual_row < 4; actual_row++)
            {
                int checked_column = 0;

                if (actual_row != rowToDelete)
                {
                    for (int actual_column = 0; actual_column < 4; actual_column++)
                    {
                        if (actual_column != columnToDelete)
                        {
                            result[checked_row, checked_column] = this[actual_row, actual_column];
                            checked_column++;
                        }
                    }
                    checked_row++;
                }
            }
            return(result);
        }