Esempio n. 1
0
        public static void Multiply(ref Matrix4 matrix1, ref Matrix2 matrix2, out Matrix4 result)
        {
            result.X.X = (matrix1.X.X * matrix2.X.X) + (matrix1.X.Y * matrix2.Y.X);
            result.X.Y = (matrix1.X.X * matrix2.X.Y) + (matrix1.X.Y * matrix2.Y.Y);
            result.X.Z = matrix1.X.Z;
            result.X.W = matrix1.X.W;

            result.Y.X = (matrix1.Y.X * matrix2.X.X) + (matrix1.Y.Y * matrix2.Y.X);
            result.Y.Y = (matrix1.Y.X * matrix2.X.Y) + (matrix1.Y.Y * matrix2.Y.Y);
            result.Y.Z = matrix1.Y.Z;
            result.Y.W = matrix1.Y.W;

            result.Z = matrix1.Z;
            result.W = matrix1.W;
        }
Esempio n. 2
0
 public static void Transform(ref Vector2 vector, ref Matrix2 matrix, out Vector2 result)
 {
     result = (matrix.X*vector.X) + (matrix.Y*vector.Y);
 }
Esempio n. 3
0
 public Matrix2 Multiply(Matrix2 matrix)
 {
     return new Matrix2
     (
         new Vector2((matrix.X.X*X.X) + (matrix.X.Y*Y.X), (matrix.X.X*X.Y) + (matrix.X.Y*Y.Y)),
         new Vector2((matrix.Y.X*X.X) + (matrix.Y.Y*Y.X), (matrix.Y.X*X.Y) + (matrix.Y.Y*Y.Y))
     );
 }
Esempio n. 4
0
        public static void Transpose(Matrix2 matrix, out Matrix2 result)
        {
            result.X.X = matrix.X.X;
            result.X.Y = matrix.Y.X;

            result.Y.X = matrix.X.Y;
            result.Y.Y = matrix.Y.Y;
        }
Esempio n. 5
0
        public static void Invert(ref Matrix2 matrix, out Matrix2 result)
        {
            float determinant = 1 / (matrix.X.X * matrix.Y.Y - matrix.X.Y * matrix.Y.X);
            result.X.X = matrix.Y.Y * determinant;
            result.X.Y = -matrix.X.Y * determinant;

            result.Y.X = -matrix.Y.X * determinant;
            result.Y.Y = matrix.X.X * determinant;
        }
Esempio n. 6
0
 public static void Transform(ref Vector2 vector, ref Matrix2 matrix, out Vector2 result)
 {
     result = (matrix.X * vector.X) + (matrix.Y * vector.Y);
 }
Esempio n. 7
0
 public void Set(Matrix2[] values)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 public static void WriteMatrix(this BinaryWriter writer, Matrix2 value)
 {
     writer.WriteVector(value.X);
     writer.WriteVector(value.Y);
 }
Esempio n. 9
0
 public Matrix4 Multiply(Matrix2 matrix)
 {
     return new Matrix4
     (
         new Vector4((matrix.X.X*X.X) + (matrix.X.Y*Y.X), (matrix.X.X*X.Y) + (matrix.X.Y*Y.Y), X.Z, X.W),
         new Vector4((matrix.Y.X*X.X) + (matrix.Y.Y*Y.X), (matrix.Y.X*X.Y) + (matrix.Y.Y*Y.Y), Y.Z, Y.W),
         Z,
         W
     );
 }
Esempio n. 10
0
        public static void Multiply(ref Matrix4 matrix1, ref Matrix2 matrix2, out Matrix4 result)
        {
            result.X.X = (matrix1.X.X*matrix2.X.X) + (matrix1.X.Y*matrix2.Y.X);
            result.X.Y = (matrix1.X.X*matrix2.X.Y) + (matrix1.X.Y*matrix2.Y.Y);
            result.X.Z = matrix1.X.Z;
            result.X.W = matrix1.X.W;

            result.Y.X = (matrix1.Y.X*matrix2.X.X) + (matrix1.Y.Y*matrix2.Y.X);
            result.Y.Y = (matrix1.Y.X*matrix2.X.Y) + (matrix1.Y.Y*matrix2.Y.Y);
            result.Y.Z = matrix1.Y.Z;
            result.Y.W = matrix1.Y.W;

            result.Z = matrix1.Z;
            result.W = matrix1.W;
        }
Esempio n. 11
0
 public static void FromCross(ref Vector2 xVector, out Matrix2 result)
 {
     result = new Matrix2(xVector, new Vector2(-xVector.Y, xVector.X));
 }
Esempio n. 12
0
 public static void Determinant(ref Matrix2 matrix, out float result)
 {
     result = matrix.X.X * matrix.Y.Y - matrix.X.Y * matrix.Y.X;
 }
Esempio n. 13
0
 public static void Abs(ref Matrix2 matrix, out Matrix2 result)
 {
     Vector2.Abs(ref matrix.X, out result.X);
     Vector2.Abs(ref matrix.Y, out result.Y);
 }
Esempio n. 14
0
		public static void WriteMatrix(this BinaryWriter writer, Matrix2 value)
		{
			writer.WriteVector(value.X);
			writer.WriteVector(value.Y);
		}
Esempio n. 15
0
 public Vector2 Transform(Matrix2 matrix)
 {
     return (matrix.X*X) + (matrix.Y*Y);
 }
Esempio n. 16
0
 public static void Abs(ref Matrix2 matrix, out Matrix2 result)
 {
     Vector2.Abs(ref matrix.X, out result.X);
     Vector2.Abs(ref matrix.Y, out result.Y);
 }
Esempio n. 17
0
        public static void Multiply(ref Matrix2x3 matrix1, ref Matrix3x2 matrix2, out Matrix2 result)
        {
            result.X.X = (matrix1.X.X * matrix2.X.X) + (matrix1.X.Y * matrix2.Y.X) + (matrix1.X.Z * matrix2.Z.X);
            result.X.Y = (matrix1.X.X * matrix2.X.Y) + (matrix1.X.Y * matrix2.Y.Y) + (matrix1.X.Z * matrix2.Z.Y);

            result.Y.X = (matrix1.Y.X * matrix2.X.X) + (matrix1.Y.Y * matrix2.Y.X) + (matrix1.Y.Z * matrix2.Z.X);
            result.Y.Y = (matrix1.Y.X * matrix2.X.Y) + (matrix1.Y.Y * matrix2.Y.Y) + (matrix1.Y.Z * matrix2.Z.Y);
        }
Esempio n. 18
0
 public static void Determinant(ref Matrix2 matrix, out float result)
 {
     result = matrix.X.X * matrix.Y.Y - matrix.X.Y * matrix.Y.X;
 }
Esempio n. 19
0
 public void Set(Matrix2 value)
 {
     valueObject.Matrix2 = value;
     Apply = setMatrix2;
 }
Esempio n. 20
0
 public static void FromCross(ref Vector2 xVector, out Matrix2 result)
 {
     result = new Matrix2(xVector, new Vector2(-xVector.Y, xVector.X));
 }
Esempio n. 21
0
 public void Set(Matrix2[] values, int offset, int count)
 {
     throw new NotImplementedException();
 }
Esempio n. 22
0
 public Vector2 Transform(Matrix2 matrix)
 {
     return((matrix.X * X) + (matrix.Y * Y));
 }