示例#1
0
 public Matrixf22 Add(Matrixf22 other)
 {
     return(new Matrixf22(
                a + other.a,
                b + other.b,
                c + other.c,
                d + other.d));
 }
示例#2
0
 public Matrixf22 Subtract(Matrixf22 other)
 {
     return(new Matrixf22(
                a - other.a,
                b - other.b,
                c - other.c,
                d - other.d));
 }
示例#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));
        }
示例#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));
 }
示例#5
0
        public bool Equals(Matrixf22 other)
        {
            var areEqual = (a == other.a) && (b == other.b) && (c == other.c) && (d == other.d);

            return(areEqual);
        }
示例#6
0
 public Matrixf22 Div(Matrixf22 other)
 {
     return(Mul(other.Inv()));
 }