differt.geometry.rotation_matrix_along_z_axis

differt.geometry.rotation_matrix_along_z_axis#

rotation_matrix_along_z_axis(angle)[source]#

Return a rotation matrix to rotate coordinates along z axis.

Parameters:

angle (Float[ArrayLike, '']) – The rotation angle, in radians.

Return type:

Float[Array, '3 3']

Returns:

The rotation matrix.

Examples

The following example shows how to rotate xyz coordinates along the z axis.

>>> from differt.geometry import (
...     rotation_matrix_along_z_axis,
... )
>>>
>>> xyz = jnp.array([1.0, 0.0, 1.0])
>>> rotation_matrix_along_z_axis(jnp.pi / 2) @ xyz
Array([-0.,  1.,  1.], dtype=float32)