Beispiel #1
0
        /// <summary>
        /// Multiplies two instances.
        /// </summary>
        /// <param name="left">The left operand of the multiplication.</param>
        /// <param name="right">The right operand of the multiplication.</param>
        /// <param name="result">A new instance that is the result of the multiplication.</param>
        public static void Mult(ref Matrix2x3 left, ref Matrix3x2 right, out Matrix2 result)
        {
            float lM11 = left.Row0.X, lM12 = left.Row0.Y, lM13 = left.Row0.Z,
                  lM21 = left.Row1.X, lM22 = left.Row1.Y, lM23 = left.Row1.Z,
                  rM11 = right.Row0.X, rM12 = right.Row0.Y,
                  rM21 = right.Row1.X, rM22 = right.Row1.Y,
                  rM31 = right.Row2.X, rM32 = right.Row2.Y;

            result.Row0.X = ((lM11 * rM11) + (lM12 * rM21)) + (lM13 * rM31);
            result.Row0.Y = ((lM11 * rM12) + (lM12 * rM22)) + (lM13 * rM32);
            result.Row1.X = ((lM21 * rM11) + (lM22 * rM21)) + (lM23 * rM31);
            result.Row1.Y = ((lM21 * rM12) + (lM22 * rM22)) + (lM23 * rM32);
        }
Beispiel #2
0
        /// <summary>
        /// Multiplies two instances.
        /// </summary>
        /// <param name="left">The left operand of the multiplication.</param>
        /// <param name="right">The right operand of the multiplication.</param>
        /// <param name="result">A new instance that is the result of the multiplication.</param>
        public static void Mult(ref Matrix2x4 left, ref Matrix4x2 right, out Matrix2 result)
        {
            float lM11 = left.Row0.X, lM12 = left.Row0.Y, lM13 = left.Row0.Z, lM14 = left.Row0.W,
                  lM21 = left.Row1.X, lM22 = left.Row1.Y, lM23 = left.Row1.Z, lM24 = left.Row1.W,
                  rM11 = right.Row0.X, rM12 = right.Row0.Y,
                  rM21 = right.Row1.X, rM22 = right.Row1.Y,
                  rM31 = right.Row2.X, rM32 = right.Row2.Y,
                  rM41 = right.Row3.X, rM42 = right.Row3.Y;

            result.M11 = (((lM11 * rM11) + (lM12 * rM21)) + (lM13 * rM31)) + (lM14 * rM41);
            result.M12 = (((lM11 * rM12) + (lM12 * rM22)) + (lM13 * rM32)) + (lM14 * rM42);
            result.M21 = (((lM21 * rM11) + (lM22 * rM21)) + (lM23 * rM31)) + (lM24 * rM41);
            result.M22 = (((lM21 * rM12) + (lM22 * rM22)) + (lM23 * rM32)) + (lM24 * rM42);
        }
        /// <summary>
        /// Multiplies two instances.
        /// </summary>
        /// <param name="left">The left operand of the multiplication.</param>
        /// <param name="right">The right operand of the multiplication.</param>
        /// <param name="result">A new instance that is the result of the multiplication.</param>
        public static void Mult(ref Matrix4x2 left, ref Matrix2 right, out Matrix4x2 result)
        {
            float lM11 = left.Row0.X, lM12 = left.Row0.Y,
                  lM21 = left.Row1.X, lM22 = left.Row1.Y,
                  lM31 = left.Row2.X, lM32 = left.Row2.Y,
                  lM41 = left.Row3.X, lM42 = left.Row3.Y,
                  rM11 = right.Row0.X, rM12 = right.Row0.Y,
                  rM21 = right.Row1.X, rM22 = right.Row1.Y;

            result.Row0.X = (lM11 * rM11) + (lM12 * rM21);
            result.Row0.Y = (lM11 * rM12) + (lM12 * rM22);
            result.Row1.X = (lM21 * rM11) + (lM22 * rM21);
            result.Row1.Y = (lM21 * rM12) + (lM22 * rM22);
            result.Row2.X = (lM31 * rM11) + (lM32 * rM21);
            result.Row2.Y = (lM31 * rM12) + (lM32 * rM22);
            result.Row3.X = (lM41 * rM11) + (lM42 * rM21);
            result.Row3.Y = (lM41 * rM12) + (lM42 * rM22);
        }
Beispiel #4
0
 /// <summary>
 /// Multiplies two instances.
 /// </summary>
 /// <param name="left">The left operand of the multiplication.</param>
 /// <param name="right">The right operand of the multiplication.</param>
 /// <returns>A new instance that is the result of the multiplication.</returns>
 public static Matrix3x2 Mult(Matrix3x2 left, Matrix2 right)
 {
     Matrix3x2 result;
     Mult(ref left, ref right, out result);
     return result;
 }