예제 #1
0
        public Transform2X getInverted()
        {
            Transform2X result = new Transform2X(a, b, c, d, tx, ty);

            result.invert();
            return(result);
        }
예제 #2
0
        public void copyFrom(Transform2X transform)
        {
            this.a = transform.a;
            this.b = transform.b;
            this.c = transform.c;
            this.d = transform.d;

            this.tx = transform.tx;
            this.ty = transform.ty;
        }
예제 #3
0
        public static Transform2X multiply(Transform2X mtx1, Transform2X mtx2, Transform2X result = null)
        {
            if (result == null)
            {
                result = new Transform2X();
            }

            result.a  = mtx1.a * mtx2.a + mtx1.c * mtx2.b;
            result.c  = mtx1.a * mtx2.c + mtx1.c * mtx2.d;
            result.tx = mtx1.a * mtx2.tx + mtx1.c * mtx2.ty + mtx1.tx;

            result.b  = mtx1.b * mtx2.a + mtx1.d * mtx2.b;
            result.d  = mtx1.b * mtx2.c + mtx1.d * mtx2.d;
            result.ty = mtx1.b * mtx2.tx + mtx1.d * mtx2.ty + mtx1.ty;

            result.u = 0;
            result.v = 0;
            result.w = 1;

            return(result);
        }