def test_rotation():
 tests = [(0, 0, 1), (0.5, 0.5, 0.5), (np.pi, 0, (-1.5))]
 for rot in tests:
  (x, y, z) = rot
  m = rotation3d(x, y, z)
  m4 = rotation(x, y, z)
  assert_array_equal(m, m4[:3, :3])
  back = rotation_angles(m)
  assert_equal(back, rot)
  back4 = rotation_angles(m4)
  assert_equal(back4, rot)

def test_rotation ( ) : tests = [ ( 0 , 0 , 1 ) , ( 0.5 , 0.5 , 0.5 ) , ( np . pi , 0 , ( - 1.5 ) ) ] for rot in tests : ( x , y , z ) = rot m = rotation3d ( x , y , z ) m4 = rotation ( x , y , z ) assert_array_equal ( m , m4 [ : 3 , : 3 ] ) back = rotation_angles ( m ) assert_equal ( back , rot ) back4 = rotation_angles ( m4 ) assert_equal ( back4 , rot )
test conversion between rotation angles and transformation matrix .