Пример #1
0
 public static Vector3d Multiply(Matrix3x3d a, Vector3d b)
 {
     return(new Vector3d
     {
         x = a.m11 * b.x + a.m12 * b.y + a.m13 * b.z,
         y = a.m21 * b.x + a.m22 * b.y + a.m23 * b.z,
         z = a.m31 * b.x + a.m32 * b.y + a.m33 * b.z,
     });
 }
Пример #2
0
 public static Matrix3x3d Scale(Matrix3x3d m, Vector3d v)
 {
     return(new Matrix3x3d
     {
         m11 = m.m11 * v.x,
         m21 = m.m21 * v.x,
         m31 = m.m31 * v.x,
         m12 = m.m12 * v.y,
         m22 = m.m22 * v.y,
         m32 = m.m32 * v.y,
         m13 = m.m13 * v.y,
         m23 = m.m23 * v.y,
         m33 = m.m33 * v.y,
     });
 }
Пример #3
0
 public static Matrix3x3d Scale(Matrix3x3d m, double s)
 {
     return(new Matrix3x3d
     {
         m11 = m.m11 * s,
         m12 = m.m12 * s,
         m13 = m.m13 * s,
         m21 = m.m21 * s,
         m22 = m.m22 * s,
         m23 = m.m23 * s,
         m31 = m.m31 * s,
         m32 = m.m32 * s,
         m33 = m.m33 * s,
     });
 }
Пример #4
0
        public static Matrix3x3d Multiply(Matrix3x3d a, Matrix3x3d b)
        {
            return(new Matrix3x3d
            {
                m11 = a.m11 * b.m11 + a.m12 * b.m21 + a.m13 * b.m31,
                m12 = a.m11 * b.m12 + a.m12 * b.m22 + a.m13 * b.m32,
                m13 = a.m11 * b.m13 + a.m12 * b.m23 + a.m13 * b.m33,

                m21 = a.m21 * b.m11 + a.m22 * b.m21 + a.m23 * b.m31,
                m22 = a.m21 * b.m12 + a.m22 * b.m22 + a.m23 * b.m32,
                m23 = a.m21 * b.m13 + a.m22 * b.m23 + a.m23 * b.m33,

                m31 = a.m31 * b.m11 + a.m32 * b.m21 + a.m33 * b.m31,
                m32 = a.m31 * b.m12 + a.m32 * b.m22 + a.m33 * b.m32,
                m33 = a.m31 * b.m13 + a.m32 * b.m23 + a.m33 * b.m33,
            });
        }