Beispiel #1
0
def test_time_dependent_inverse():
    quats1_2 = [[1.0 / np.sqrt(2), 0, 0, 1.0 / np.sqrt(2)], [1, 0, 0, 0]]
    times1_2 = [0, 1]
    rot1_2 = TimeDependentRotation(quats1_2, times1_2, 1, 2)
    rot2_1 = rot1_2.inverse()
    assert rot2_1.source == 2
    assert rot2_1.dest == 1
    expected_quats = np.array([[1.0 / np.sqrt(2), 0, 0, -1.0 / np.sqrt(2)],
                               [1, 0, 0, 0]])
    np.testing.assert_equal(rot2_1.times, np.array(times1_2))
    np.testing.assert_almost_equal(rot2_1.quats, expected_quats)
Beispiel #2
0
def test_time_dependent_inverse():
    quats1_2 = [[1.0 / np.sqrt(2), 0, 0, 1.0 / np.sqrt(2)], [1, 0, 0, 0]]
    times1_2 = [0, 1]
    av1_2 = [[np.pi / 2, 0, 0], [np.pi / 2, 0, 0]]
    rot1_2 = TimeDependentRotation(quats1_2, times1_2, 1, 2, av=av1_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)],
                      [1, 0, 0, 0]]
    expected_av = [[-np.pi / 2, 0, 0], [-np.pi / 2, 0, 0]]
    np.testing.assert_equal(rot2_1.times, times1_2)
    np.testing.assert_almost_equal(rot2_1.quats, expected_quats)
    np.testing.assert_almost_equal(rot2_1.av, expected_av)