pytransform3d.transformations
.dq_prod_vector#
- pytransform3d.transformations.dq_prod_vector(dq, v)[source]#
Apply transform represented by a dual quaternion to a vector.
To apply the transformation defined by a unit dual quaternion \(\boldsymbol{q}\) to a point \(\boldsymbol{v} \in \mathbb{R}^3\), we first represent the vector as a dual quaternion: we set the real part to (1, 0, 0, 0) and the dual part is a pure quaternion with the scalar part 0 and the vector as its vector part \(\left(\begin{array}{c}0\\\boldsymbol{v}\end{array}\right) \in \mathbb{R}^4\). Then we left-multiply the dual quaternion and right-multiply its dual quaternion conjugate
\[\begin{split}\left(\begin{array}{c}1\\0\\0\\0\\0\\\boldsymbol{w}\end{array}\right) = \boldsymbol{q} \cdot \left(\begin{array}{c}1\\0\\0\\0\\0\\\boldsymbol{v}\end{array}\right) \cdot \boldsymbol{q}^*.\end{split}\]The vector part of the dual part \(\boldsymbol{w}\) of the resulting quaternion is the rotated point.
- Parameters:
- dqarray-like, shape (8,)
Unit dual quaternion to represent transform: (pw, px, py, pz, qw, qx, qy, qz)
- varray-like, shape (3,)
3d vector
- Returns:
- warray, shape (3,)
3d vector