jaxtransform3d.transformations.apply_dual_quaternion#
- jaxtransform3d.transformations.apply_dual_quaternion(dual_quat: Array | ndarray | bool_ | number | bool | int | float | complex, v: Array | ndarray | bool_ | number | bool | int | float | complex) Array [source]#
Apply transform represented by a dual quaternion to a vector.
To apply the transformation defined by a unit dual quaternion \(\sigma\) 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) = \sigma \cdot \left(\begin{array}{c}1\\0\\0\\0\\0\\\boldsymbol{v}\end{array}\right) \cdot \sigma^*.\end{split}\]The vector part of the dual part \(\boldsymbol{w}\) of the resulting quaternion is the rotated point.
- Parameters:
- dual_quatarray-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