Esempio n. 1
0
 def test_rotate_trivial(self):
     np.testing.assert_almost_equal(
         MathUtils.rotate(np.array([[1,0]]),0),
         np.array([[1,0]])
         )
     np.testing.assert_almost_equal(
         MathUtils.rotate(np.array([[1,0]]),math.pi / 2),
         np.array([[0,1]])
         )
     np.testing.assert_almost_equal(
         MathUtils.rotate(np.array([[1,0]]),2 * math.pi / 2),
         np.array([[-1,0]])
         )
     np.testing.assert_almost_equal(
         MathUtils.rotate(np.array([[1,0]]),3 * math.pi / 2),
         np.array([[0,-1]])
         )
Esempio n. 2
0
 def test_rotate(self, points, radians):
     np.testing.assert_almost_equal(
         MathUtils.rotate(MathUtils.rotate(points, radians), -radians),
         points
         )