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; }
public static void Transform(ref Vector2 vector, ref Matrix2 matrix, out Vector2 result) { result = (matrix.X*vector.X) + (matrix.Y*vector.Y); }
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)) ); }
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; }
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; }
public static void Transform(ref Vector2 vector, ref Matrix2 matrix, out Vector2 result) { result = (matrix.X * vector.X) + (matrix.Y * vector.Y); }
public void Set(Matrix2[] values) { throw new NotImplementedException(); }
public static void WriteMatrix(this BinaryWriter writer, Matrix2 value) { writer.WriteVector(value.X); writer.WriteVector(value.Y); }
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 ); }
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; }
public static void FromCross(ref Vector2 xVector, out Matrix2 result) { result = new Matrix2(xVector, new Vector2(-xVector.Y, xVector.X)); }
public static void Determinant(ref Matrix2 matrix, out float result) { result = matrix.X.X * matrix.Y.Y - matrix.X.Y * matrix.Y.X; }
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); }
public Vector2 Transform(Matrix2 matrix) { return (matrix.X*X) + (matrix.Y*Y); }
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); }
public void Set(Matrix2 value) { valueObject.Matrix2 = value; Apply = setMatrix2; }
public void Set(Matrix2[] values, int offset, int count) { throw new NotImplementedException(); }
public Vector2 Transform(Matrix2 matrix) { return((matrix.X * X) + (matrix.Y * Y)); }