differt.geometry.rotation_matrix_along_x_axis

differt.geometry.rotation_matrix_along_x_axis#

rotation_matrix_along_x_axis(angle)[source]#

Return a rotation matrix to rotate coordinates along x 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 x axis.

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