Example #1
0
def test_quaternion_from_euler_angles():
    axis = [1.0, 0.0, 0.0]
    angle = math.pi / 2
    assert allclose(quaternion_from_axis_angle(axis, angle),
                    quaternion_from_euler_angles([math.pi / 2, 0, 0]))
Example #2
0
def test_quaternion_from_axis_angle():
    axis = [1.0, 0.0, 0.0]
    angle = math.pi / 2
    q = quaternion_from_axis_angle(axis, angle)
    assert allclose(q, [math.sqrt(2) / 2, math.sqrt(2) / 2, 0, 0])
Example #3
0
def test_euler_angles_from_quaternion():
    axis = [1.0, 0.0, 0.0]
    angle = math.pi / 2
    q = quaternion_from_axis_angle(axis, angle)
    assert allclose(euler_angles_from_quaternion(q), [math.pi / 2, 0, 0])