Cromon

LinearMatrix.cs

Oct 25th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1.         public static LinearMatrix operator * (LinearMatrix m1, LinearMatrix m2)
  2.         {
  3.             LinearMatrix ret = new LinearMatrix()
  4.             {
  5.                 M11 = m1.M11 * m2.M11 + m1.M12 * m2.M21 + m1.M13 * m2.M31,
  6.                 M21 = m1.M21 * m2.M11 + m1.M22 * m2.M21 + m1.M23 * m2.M31,
  7.                 M31 = m1.M31 * m2.M11 + m1.M32 * m2.M21 + m1.M33 * m2.M31,
  8.  
  9.                 M12 = m1.M11 * m2.M12 + m1.M12 * m2.M22 + m1.M13 * m2.M32,
  10.                 M22 = m1.M21 * m2.M12 + m1.M22 * m2.M22 + m1.M23 * m2.M32,
  11.                 M32 = m1.M31 * m2.M12 + m1.M32 * m2.M22 + m1.M33 * m2.M32,
  12.  
  13.                 M13 = m1.M11 * m2.M13 + m1.M12 * m2.M23 + m1.M13 * m2.M33,
  14.                 M23 = m1.M21 * m2.M13 + m1.M22 * m2.M23 + m1.M23 * m2.M33,
  15.                 M33 = m1.M31 * m2.M13 + m1.M32 * m2.M32 + m1.M33 * m2.M33
  16.             };
  17.  
  18.             return ret;
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment