warp.quat_from_euler#

warp.quat_from_euler(e: vec3f, i: int, j: int, k: int) → quatf[source]#
  • Kernel: true
  • Python: true
  • Differentiable: true

Return the rotation quaternion for Euler angles in radians and an axis sequence.

The rotations about axes i, j, and k are applied in that order about the fixed axes (extrinsic), which is equivalent to applying them in the order k, j, i about the rotating axes (intrinsic). For example, quat_from_euler(e, 0, 1, 2) equals quat_rpy(e[0], e[1], e[2]).

For proper Euler sequences (i == k), e[i] is used for both the first and the third rotation.

Parameters:
  • e – Euler angles in radians, indexed by axis, not by sequence position: e[0] is the angle about X, e[1] about Y, and e[2] about Z.

  • i – Index of the first axis, in {0, 1, 2}.

  • j – Index of the second axis, in {0, 1, 2} and different from i.

  • k – Index of the third axis, in {0, 1, 2} and different from j.

Returns:

Unit quaternion qk * qj * qi, where qi is the rotation of e[i] about axis i, and similarly for qj and qk.

Return type:

warp.quat