Ejemplo n.º 1
0
        public void TestRotation2()
        {
            float  degree = 90.0f;
            double theta  = Transformation.DegreeToRadian(degree);

            var c  = new PointF(5, 5);
            var p1 = new PointF(1, 1);

            var r1a = Transformation.Rotate(p1, c, degree);
            var r1b = Transformation.RotateRadians(p1, c, theta);

            Assert.IsTrue(r1a == r1b, "Not equal: " + r1a + " != " + r1b);

            var p2  = new PointF(9, 5);
            var r2a = Transformation.Rotate(p2, c, degree);
            var r2b = Transformation.RotateRadians(p2, c, theta);

            Assert.IsTrue(r2a == r2b, "Not equal: " + r2a + " != " + r2b);

            var p3  = new PointF(2, -4);
            var r3a = Transformation.Rotate(p3, c, degree);
            var r3b = Transformation.RotateRadians(p3, c, theta);

            Assert.IsTrue(r3a == r3b, "Not equal: " + r3a + " != " + r3b);
        }