示例#1
0
    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)
示例#2
0
    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])