def test_single_frame_HTM_inverse(): f1 = Frame([124, -343, -13], [27, 49, 62], degrees=True) t = transform(None, f1) t_ = transform(f1, None) assert_almost_equal(t._HTM, t_.inv().HTM)
def test_single_frame_translation(): f1 = Frame([1, 1, 1], [0, 0, 90], degrees=True) t = transform(None, f1) assert_almost_equal([1, 1, 1], t.translation) t_ = transform(f1, None) assert_almost_equal([-1, 1, -1], t_.translation)
def test_single_frame_vector(): f1 = Frame([1, 1, 1], [0, 90, 90], degrees=True) t = transform(None, f1) assert_almost_equal([0, 0, 0], t.apply_vector([0, 0, 0])) assert_almost_equal([0, 0, -1], t.apply_vector([1, 0, 0])) assert_almost_equal([-1, 0, 0], t.apply_vector([0, 1, 0])) assert_almost_equal([0, 1, 0], t.apply_vector([0, 0, 1]))
def test_single_frame_position(): f1 = Frame([1, 1, 1], [90, 0, 90], degrees=True) t = transform(None, f1) assert_almost_equal([1, 1, 1], t.apply_position([0, 0, 0])) assert_almost_equal([1, 2, 1], t.apply_position([1, 0, 0])) assert_almost_equal([1, 1, 2], t.apply_position([0, 1, 0])) assert_almost_equal([2, 1, 1], t.apply_position([0, 0, 1]))