public void simpleTransformTest()
        {
            {
                LDSimpleAffineTransform t=new LDSimpleAffineTransform();

                t.setOrigin(new LDPoint(100, 100));
                t.setRotateDeg(90);
                LDPoint src=new LDPoint(1, 0);
                LDPoint dst;
                dst = t.transform(src);

                TestUtil.COMPARE(dst.x(), (double)100);
                TestUtil.COMPARE(dst.y(), (double)100 + 1);

            }
            {
                LDSimpleAffineTransform t=new LDSimpleAffineTransform();

                t.setOrigin(new LDPoint(100, 100));
                t.setRotateDeg(90);
                t.setScale(2);

                LDPoint src=new LDPoint(5, 5);
                LDPoint dst;

                dst = t.transform(src);

                TestUtil.COMPARE(dst.x(), 90.0);
                TestUtil.COMPARE(dst.y(), 110.0);

            }
        }
Exemple #2
0
        public void simpleTransformTest()
        {
            {
                LDSimpleAffineTransform t = new LDSimpleAffineTransform();

                t.setOrigin(new LDPoint(100, 100));
                t.setRotateDeg(90);
                LDPoint src = new LDPoint(1, 0);
                LDPoint dst;
                dst = t.transform(src);


                TestUtil.COMPARE(dst.x(), (double)100);
                TestUtil.COMPARE(dst.y(), (double)100 + 1);
            }
            {
                LDSimpleAffineTransform t = new LDSimpleAffineTransform();

                t.setOrigin(new LDPoint(100, 100));
                t.setRotateDeg(90);
                t.setScale(2);

                LDPoint src = new LDPoint(5, 5);
                LDPoint dst;

                dst = t.transform(src);

                TestUtil.COMPARE(dst.x(), 90.0);
                TestUtil.COMPARE(dst.y(), 110.0);
            }
        }
Exemple #3
0
        public void inverseTransformTest()
        {
            {
                LDSimpleAffineTransform t = new LDSimpleAffineTransform();

                t.setOrigin(new LDPoint(100, 100));
                t.setRotateDeg(90);
                LDPoint src = new LDPoint(100, 101);
                LDPoint dst;
                dst = t.inverseTransform(src);


                TestUtil.COMPARE(dst.x(), (double)1);
                TestUtil.LDFUZZY_COMPARE(dst.y(), (double)0, 0.0001);
            }
        }
        public void inverseTransformTest()
        {
            {
                LDSimpleAffineTransform t=new LDSimpleAffineTransform();

                t.setOrigin(new LDPoint(100, 100));
                t.setRotateDeg(90);
                LDPoint src=new LDPoint(100, 101);
                LDPoint dst;
                dst = t.inverseTransform(src);

                TestUtil.COMPARE(dst.x(), (double)1);
                TestUtil.LDFUZZY_COMPARE(dst.y(), (double)0, 0.0001);

            }
        }