public static Mat22 operator +(Mat22 A, Mat22 B) { Mat22 C = new Mat22(); C.Set(A.Col1 + B.Col1, A.Col2 + B.Col2); return(C); }
/// <summary> /// A * B /// </summary> public static Mat22 Mul(Mat22 A, Mat22 B) { Mat22 C = new Mat22(); C.Set(Math.Mul(A, B.Col1), Math.Mul(A, B.Col2)); return(C); }
public static Mat22 Abs(Mat22 A) { Mat22 B = new Mat22(); B.Set(Math.Abs(A.Col1), Math.Abs(A.Col2)); return(B); }
public static Mat22 operator +(Mat22 A, Mat22 B) { Mat22 result = default(Mat22); result.Set(A.Col1 + B.Col1, A.Col2 + B.Col2); return(result); }
public static Mat22 Abs(Mat22 A) { Mat22 result = default(Mat22); result.Set(Math.Abs(A.Col1), Math.Abs(A.Col2)); return(result); }
public static Mat22 Mul(Mat22 A, Mat22 B) { Mat22 result = default(Mat22); result.Set(Math.Mul(A, B.Col1), Math.Mul(A, B.Col2)); return(result); }
/// <summary> /// A^T * B /// </summary> public static Mat22 MulT(Mat22 A, Mat22 B) { Vec2 c1 = new Vec2(); c1.Set(Vec2.Dot(A.Col1, B.Col1), Vec2.Dot(A.Col2, B.Col1)); Vec2 c2 = new Vec2(); c2.Set(Vec2.Dot(A.Col1, B.Col2), Vec2.Dot(A.Col2, B.Col2)); Mat22 C = new Mat22(); C.Set(c1, c2); return(C); }
public static Mat22 MulT(Mat22 A, Mat22 B) { Vec2 c = default(Vec2); c.Set(Vec2.Dot(A.Col1, B.Col1), Vec2.Dot(A.Col2, B.Col1)); Vec2 c2 = default(Vec2); c2.Set(Vec2.Dot(A.Col1, B.Col2), Vec2.Dot(A.Col2, B.Col2)); Mat22 result = default(Mat22); result.Set(c, c2); return(result); }
public static Mat22 operator +(Mat22 A, Mat22 B) { Mat22 C = new Mat22(); C.Set(A.Col1 + B.Col1, A.Col2 + B.Col2); return C; }
/// Set this based on the position and angle. public void Set(Vec2 p, float angle) { Position = p; R.Set(angle); }