Beispiel #1
0
        public b2Mat22 GetInverse()
        {
            float   a   = ex.X;
            float   b   = ey.X;
            float   c   = ex.Y;
            float   d   = ey.Y;
            float   det = a * d - b * c;
            b2Mat22 B   = new b2Mat22();

            if (det != 0.0f)
            {
                det = 1.0f / det;
            }
            B.ex.X = det * d; B.ey.X = -det * b;
            B.ex.Y = -det * c; B.ey.Y = det * a;
            return(B);
        }
Beispiel #2
0
 public static Vector2D Mul(b2Mat22 A, Vector2D v)
 {
     return(new Vector2D(A.ex.X * v.X + A.ey.X * v.Y, A.ex.Y * v.X + A.ey.Y * v.Y));
 }