warp.quat_to_euler#

warp.quat_to_euler(
q: quatf,
i: int,
j: int,
k: int,
) vec3f#
  • Kernel

  • Differentiable

Convert a quaternion into Euler angles for an axis sequence.

The integers i, j, and k are axis indices in {0, 1, 2} with i != j and j != k. Axis-indexed output (suitable for quat_from_euler()) is supported for Tait-Bryan sequences (i != k).

Caution

This function returns an axis-indexed vector where e[0] is the angle about X, e[1] about Y, and e[2] about Z.

That layout is only unambiguous for Tait-Bryan sequences (i != k), where all three rotations use distinct axis slots.

For proper Euler sequences (i == k), the first and third rotations are both about the same axis. In that case, two different sequence positions must share one output slot, so the mapping loses information and cannot be a clean inverse of quat_from_euler().

Parameters:
  • q – Input quaternion.

  • i – Index of the first axis.

  • j – Index of the second axis.

  • k – Index of the third axis.

Returns:

Euler angles in radians.

Return type:

wp.vec3