Пример #1
0
def test_constant_inverse():
    rot1_2 = ConstantRotation([1.0 / np.sqrt(2), 0, 0, 1.0 / np.sqrt(2)], 1, 2)
    rot2_1 = rot1_2.inverse()
    assert rot2_1.source == 2
    assert rot2_1.dest == 1
    expected_quats = [1.0 / np.sqrt(2), 0, 0, -1.0 / np.sqrt(2)]
    np.testing.assert_almost_equal(rot2_1.quat, expected_quats)
Пример #2
0
def test_constant_inverse():
    rot1_2 = ConstantRotation(
        np.array([1.0 / np.sqrt(2), 0, 0, 1.0 / np.sqrt(2)]), 1, 2)
    rot2_1 = rot1_2.inverse()
    assert rot2_1.source == 2
    assert rot2_1.dest == 1
    np.testing.assert_almost_equal(
        rot2_1.quat, np.array([1.0 / np.sqrt(2), 0, 0, -1.0 / np.sqrt(2)]))