Beispiel #1
0
        public void testGetAngleOfRotation90Deg()
        {
            double x1 = 0;
            double y1 = 0;
            double x2 = 0;
            double y2 = 5;

            float result = (float)Mathy.getAngleOfRotation(x1, y1, x2, y2) * Mathf.Rad2Deg;

            Assert.AreEqual(90.0f, result);
        }
Beispiel #2
0
        public void testGetAngleOfRotationInQuadrant4()
        {
            double x1 = 0;
            double y1 = 0;
            double x2 = 5;
            double y2 = -5;

            float result = (float)Mathy.getAngleOfRotation(x1, y1, x2, y2) * Mathf.Rad2Deg;

            Assert.GreaterOrEqual(result, -90);
            Assert.LessOrEqual(result, 0);
            Assert.AreEqual(-45.0f, result);
        }