示例#1
0
 def test_conjugate_identity(self):
     qr = Quaternion(1, 2, 3, 4)
     qt = Quaternion(1, 3, 3, 0)
     dq = DualQuaternion(qr, qt)
     # TODO(ff): Here we should use dq*dq.conjugate() in one
     # place.
     q_rot_identity = dq.q_rot * dq.q_rot.conjugate()
     q_dual_identity = (dq.q_rot.conjugate() * dq.q_dual +
                        dq.q_dual.conjugate() * dq.q_rot)
     identity_dq_expected = DualQuaternion(q_rot_identity, q_dual_identity)
     npt.assert_allclose((dq * dq.conjugate()).dq,
                         identity_dq_expected.dq,
                         atol=1e-6)
示例#2
0
 def test_conjugate(self):
     qr = Quaternion(1., 2., 3., 4.)
     qt = Quaternion(1., 3., 3., 5.)
     dq = DualQuaternion(qr, qt)
     dq_expected = np.array([-1., -2., -3., 4., -1., -3., -3., 5.]).T
     npt.assert_allclose((dq.conjugate()).dq, dq_expected, atol=1e-6)