jaxtransform3d.rotations.quaternion_conjugate#

jaxtransform3d.rotations.quaternion_conjugate(q: Array | ndarray | bool_ | number | bool | int | float | complex) Array[source]#

Conjugate of quaternion.

The conjugate of a unit quaternion inverts the rotation represented by this unit quaternion.

The conjugate of a quaternion \(\boldsymbol{q}\) is often denoted as \(\boldsymbol{q}^*\). For a quaternion \(\boldsymbol{q} = w + x \boldsymbol{i} + y \boldsymbol{j} + z \boldsymbol{k}\) it is defined as

\[\boldsymbol{q}^* = w - x \boldsymbol{i} - y \boldsymbol{j} - z \boldsymbol{k}.\]
Parameters:
qarray-like, shape (…, 4)

Unit quaternion to represent rotation: (w, x, y, z).

Returns:
q_carray-like, shape (…, 4)

Conjugate (w, -x, -y, -z).

See also

matrix_inverse

Invert rotation matrix.

Examples

>>> import jax.numpy as jnp
>>> from jaxtransform3d.rotations import quaternion_conjugate
>>> quaternion_conjugate(jnp.array([4., 2., 1., 3.]))
Array([ 4., -2., -1., -3.], dtype=...)