Ejemplo n.º 1
0
        public static Mat22 operator +(Mat22 A, Mat22 B)
        {
            Mat22 C = new Mat22();

            C.Set(A.Col1 + B.Col1, A.Col2 + B.Col2);
            return(C);
        }
Ejemplo n.º 2
0
        public static Mat22 Abs(Mat22 A)
        {
            Mat22 B = new Mat22();

            B.Set(MathB2.Abs(A.Col1), MathB2.Abs(A.Col2));
            return(B);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// A * B
        /// </summary>
        public static Mat22 Mul(Mat22 A, Mat22 B)
        {
            Mat22 C = new Mat22();

            C.Set(MathB2.Mul(A, B.Col1), MathB2.Mul(A, B.Col2));
            return(C);
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
 /// Set this based on the position and angle.
 public void Set(Vec2 p, float angle)
 {
     Position = p;
     R.Set(angle);
 }