Beispiel #1
0
        public int Determinant()
        {
            int ff_det;

            ff_det = MathFP.Mul(Sx, Sy) - MathFP.Mul(Rx, Ry);
            return(ff_det);
        }
Beispiel #2
0
        public MatrixFP Rotate(int ff_ang)
        {
            int ff_sin = MathFP.Sin(ff_ang);
            int ff_cos = MathFP.Cos(ff_ang);

            return(Multiply(new MatrixFP(ff_cos, ff_cos, ff_sin, -ff_sin, 0, 0)));
        }
Beispiel #3
0
        public MatrixFP Invert()
        {
            int ff_det = Determinant();

            if (ff_det == 0)
            {
                Reset();
            }
            else
            {
                int ff_sx_new = MathFP.Div(Sy, ff_det);
                int ff_sy_new = MathFP.Div(Sx, ff_det);
                int ff_rx_new = -MathFP.Div(Rx, ff_det);
                int ff_ry_new = -MathFP.Div(Ry, ff_det);
                int ff_tx_new = MathFP.Div(MathFP.Mul(Ty, Ry) - MathFP.Mul(Tx, Sy), ff_det);
                int ff_ty_new = -MathFP.Div(MathFP.Mul(Ty, Sx) - MathFP.Mul(Tx, Rx), ff_det);
                Reset(ff_sx_new, ff_sy_new, ff_rx_new, ff_ry_new, ff_tx_new, ff_ty_new);
            }
            return(this);
        }
Beispiel #4
0
 public MatrixFP Multiply(MatrixFP m)
 {
     Reset(MathFP.Mul(m.Sx, Sx) + MathFP.Mul(m.Ry, Rx), MathFP.Mul(m.Rx, Ry) + MathFP.Mul(m.Sy, Sy), MathFP.Mul(m.Rx, Sx) + MathFP.Mul(m.Sy, Rx), MathFP.Mul(m.Sx, Ry) + MathFP.Mul(m.Ry, Sy), MathFP.Mul(m.Sx, Tx) + MathFP.Mul(m.Ry, Ty) + m.Tx, MathFP.Mul(m.Rx, Tx) + MathFP.Mul(m.Sy, Ty) + m.Ty);
     return(this);
 }
Beispiel #5
0
 public MatrixFP Scale(int ff_sx, int ff_sy)
 {
     Reset(MathFP.Mul(ff_sx, this.Sx), MathFP.Mul(ff_sy, this.Sy), MathFP.Mul(ff_sy, this.Rx), MathFP.Mul(ff_sx, this.Ry), MathFP.Mul(ff_sx, this.Tx), MathFP.Mul(ff_sy, this.Ty));
     return(this);
 }