def test_from_rotation_other_type(self): r = RotationD() r_cpy = RotationF(r) numpy.testing.assert_array_almost_equal(r.quaternion(), r_cpy.quaternion(), 6) r = RotationD([1, 2, 3, 4]) r_cpy = RotationF(r) numpy.testing.assert_array_almost_equal(r.quaternion(), r_cpy.quaternion(), 6) r = RotationF() r_cpy = RotationD(r) numpy.testing.assert_array_almost_equal(r.quaternion(), r_cpy.quaternion(), 6) r = RotationF([1, 2, 3, 4]) r_cpy = RotationD(r) numpy.testing.assert_array_almost_equal(r.quaternion(), r_cpy.quaternion(), 6)
def test_from_quaternion(self): q = array_normalize([+2, -1, -3, +0], float) r = RotationD(q) numpy.testing.assert_equal(r.quaternion(), q)
def test_to_quaternion(self): rot_d = RotationD() numpy.testing.assert_array_equal(rot_d.quaternion(), [0, 0, 0, 1]) rot_f = RotationF() numpy.testing.assert_array_equal(rot_f.quaternion(), [0, 0, 0, 1])