def scalar(self):
    """ The scalar part of the dual quaternion.

    Defined as: scalar(dq) := 0.5*(dq+dq.conjugate())
    """
    scalar_part = 0.5 * (self + self.conjugate())
    npt.assert_allclose(
        scalar_part.dq[[0, 1, 2, 4, 5, 6]], np.zeros(6), atol=1e-6)
    return scalar_part.copy()
 The scalar part of the dual quaternion.

    Defined as: scalar(dq) := 0.5*(dq+dq.conjugate())
    
hand_eye_calibration/python/hand_eye_calibration/dual_quaternion.py