def __init__(self, qr=[1,0,0,0], qd=[0,0,0,0], enforce_unit_norm=True):
        """Initialize a dual quaternion.

        Parameters
        ----------
        qr : :obj:`numpy.ndarray` of float
            A 4-entry quaternion in wxyz format.

        qd : :obj:`numpy.ndarray` of float
            A 4-entry quaternion in wxyz format.

        enforce_unit_norm : bool
            If true, raises a ValueError when the quaternion is not normalized.

        Raises
        ------
        ValueError
            If enforce_unit_norm is True and the norm of qr is not 1.
        """
        self.qr = qr
        self.qd = qd

        if enforce_unit_norm:
            norm = self.norm
            if not np.allclose(norm[0], [1]):
                raise ValueError("Dual quaternion does not have norm 1! Got {0}".format(norm[0]))
def __init__ ( self , qr = [ 1 , 0 , 0 , 0 ] , qd = [ 0 , 0 , 0 , 0 ] , enforce_unit_norm = True ) : self . qr = qr self . qd = qd if enforce_unit_norm : norm = self . norm if not np . allclose ( norm [ 0 ] , [ 1 ] ) : raise ValueError ( "Dual quaternion does not have norm 1! Got {0}" . format ( norm [ 0 ] ) )
Initialize a dual quaternion.

        Parameters
        ----------
        qr : :obj:`numpy.ndarray` of float
            A 4-entry quaternion in wxyz format.

        qd : :obj:`numpy.ndarray` of float
            A 4-entry quaternion in wxyz format.

        enforce_unit_norm : bool
            If true, raises a ValueError when the quaternion is not normalized.

        Raises
        ------
        ValueError
            If enforce_unit_norm is True and the norm of qr is not 1.