jaxtransform3d.rotations.norm_quaternion#

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

Normalize quaternion to unit norm.

Parameters:
qarray-like, shape (…, 4)

Quaternion to normalize.

Returns:
q_normarray, shape (…, 4)

Normalized quaternion.

See also

norm_matrix

Normalizes a rotation matrix.

Examples

>>> import jax.numpy as jnp
>>> from jaxtransform3d.rotations import norm_quaternion
>>> norm_quaternion(jnp.array([2., 0., 0., 0.]))
Array([1., 0., 0., 0.], dtype=...)