Esempio n. 1
0
 public Matrixf22 Add(Matrixf22 other)
 {
     return(new Matrixf22(
                a + other.a,
                b + other.b,
                c + other.c,
                d + other.d));
 }
Esempio n. 2
0
 public Matrixf22 Subtract(Matrixf22 other)
 {
     return(new Matrixf22(
                a - other.a,
                b - other.b,
                c - other.c,
                d - other.d));
 }
Esempio n. 3
0
        public Matrixf22 Mul(Matrixf22 other)
        {
            var newA = a * other.a + b * other.c;
            var newB = a * other.b + b * other.d;
            var newC = c * other.a + d * other.c;
            var newD = c * other.b + d * other.d;

            return(new Matrixf22(newA, newB, newC, newD));
        }
Esempio n. 4
0
 public static Vector2 Mul(this Vector2 v, Matrixf22 m)
 {
     return(new Vector2(
                v.x * m.a + v.y * m.c,
                v.x * m.b + v.y * m.d));
 }
Esempio n. 5
0
        public bool Equals(Matrixf22 other)
        {
            var areEqual = (a == other.a) && (b == other.b) && (c == other.c) && (d == other.d);

            return(areEqual);
        }
Esempio n. 6
0
 public Matrixf22 Div(Matrixf22 other)
 {
     return(Mul(other.Inv()));
 }