def test_vector_rotation():
 x = np.array([1.0, 0.0, 0.0])
 y = np.array([0.0, 1.0, 0.0])
 rot = _find_vector_rotation(x, y)
 assert_array_equal(rot, [[0, (-1), 0], [1, 0, 0], [0, 0, 1]])
 quat_1 = rot_to_quat(rot)
 quat_2 = rot_to_quat(np.eye(3))
 assert_allclose(_angle_between_quats(quat_1, quat_2), (np.pi / 2.0))

def test_vector_rotation ( ) : x = np . array ( [ 1.0 , 0.0 , 0.0 ] ) y = np . array ( [ 0.0 , 1.0 , 0.0 ] ) rot = _find_vector_rotation ( x , y ) assert_array_equal ( rot , [ [ 0 , ( - 1 ) , 0 ] , [ 1 , 0 , 0 ] , [ 0 , 0 , 1 ] ] ) quat_1 = rot_to_quat ( rot ) quat_2 = rot_to_quat ( np . eye ( 3 ) ) assert_allclose ( _angle_between_quats ( quat_1 , quat_2 ) , ( np . pi / 2.0 ) )
test basic rotation matrix math .