Example #1
0
 public static FMat2 Transpose(FMat2 m)
 {
     return(new FMat2
            (
                new FVec2(m.x.x, m.y.x),
                new FVec2(m.x.y, m.y.y)
            ));
 }
Example #2
0
        public static FMat2 Invert(FMat2 m)
        {
            Fix64 determinant = Fix64.One / (m.x.x * m.y.y - m.x.y * m.y.x);
            FMat2 result;

            result.x.x = m.y.y * determinant;
            result.x.y = -m.x.y * determinant;
            result.y.x = -m.y.x * determinant;
            result.y.y = m.x.x * determinant;
            return(result);
        }
Example #3
0
        public void NonhomogeneousInverse()
        {
            FMat2 m3 = this;

            m3.Invert();
            this.x = m3.x;
            this.y = m3.y;
            FVec3 v = m3 * this.z;

            this.z.x = -v.x;
            this.z.y = -v.y;
        }
Example #4
0
        public static FMat3 NonhomogeneousInverse(FMat3 m)
        {
            FMat2 m2 = m;

            m2.Invert();
            FMat3 o = m2;
            FVec3 v = m2 * m.z;

            o.z.x = -v.x;
            o.z.y = -v.y;
            return(o);
        }