Ejemplo n.º 1
0
        public static Matrix3F operator -( Matrix3F a, Matrix3F b )
        {
            var sumMatrix = new Matrix3F
                            {
                                A00 = (a.A00 - b.A00),
                                A01 = (a.A01 - b.A01),
                                A02 = (a.A02 - b.A02),
                                A10 = (a.A10 - b.A10),
                                A11 = (a.A11 - b.A11),
                                A12 = (a.A12 - b.A12),
                                A20 = (a.A20 - b.A20),
                                A21 = (a.A21 - b.A21),
                                A22 = (a.A22 - b.A22)
                            };

            return sumMatrix;
        }
Ejemplo n.º 2
0
        public static Matrix3F operator +( Matrix3F a, Matrix3F b )
        {
            var sumMatrix = new Matrix3F
                            {
                                A00 = (a.A00 + b.A00),
                                A01 = (a.A01 + b.A01),
                                A02 = (a.A02 + b.A02),
                                A10 = (a.A10 + b.A10),
                                A11 = (a.A11 + b.A11),
                                A12 = (a.A12 + b.A12),
                                A20 = (a.A20 + b.A20),
                                A21 = (a.A21 + b.A21),
                                A22 = (a.A22 + b.A22)
                            };

            return sumMatrix;
        }
Ejemplo n.º 3
0
        public static Matrix3F operator *( Matrix3F a, float value )
        {
            var mulMatrix = new Matrix3F();

            for (var i = 0; i < mulMatrix.data.Length; i++)
                mulMatrix.data[i] = a.data[i] * value;

            return mulMatrix;
        }
Ejemplo n.º 4
0
        public static Matrix3F operator *( Matrix3F a, Matrix3F b )
        {
            var sumMatrix = new Matrix3F
                            {
                                A00 = (a[0, 0]*b[0, 0] + a[0, 1]*b[1, 0] + a[0, 2]*b[2, 0]),
                                A01 = (a[0, 0]*b[0, 1] + a[0, 1]*b[1, 1] + a[0, 2]*b[2, 1]),
                                A02 = (a[0, 0]*b[0, 2] + a[0, 1]*b[1, 2] + a[0, 2]*b[2, 2]),
                                A10 = (a[1, 0]*b[0, 0] + a[1, 1]*b[1, 0] + a[1, 2]*b[2, 0]),
                                A11 = (a[1, 0]*b[0, 1] + a[1, 1]*b[1, 1] + a[1, 2]*b[2, 1]),
                                A12 = (a[1, 0]*b[0, 2] + a[1, 1]*b[1, 2] + a[1, 2]*b[2, 2]),
                                A20 = (a[2, 0]*b[0, 0] + a[2, 1]*b[1, 0] + a[2, 2]*b[2, 0]),
                                A21 = (a[2, 0]*b[0, 1] + a[2, 1]*b[1, 1] + a[2, 2]*b[2, 1]),
                                A22 = (a[2, 0]*b[0, 2] + a[2, 1]*b[1, 2] + a[2, 2]*b[2, 2]),
                            };

            return sumMatrix;
        }
Ejemplo n.º 5
0
 public void SetInvertToMatrix( Matrix3F matrix )
 {
     matrix[0] = +cosPitch;          matrix[1] = 0;       matrix[2] = sinPitch;
     matrix[3] = -sinPitch * sinYaw; matrix[4] = +cosYaw; matrix[5] = sinYaw * cosPitch;
     matrix[6] = -sinPitch * cosYaw; matrix[7] = -sinYaw; matrix[8] = cosYaw * cosPitch;
 }