warp.quat_from_euler#
- warp.quat_from_euler(e: vec3f, i: int, j: int, k: int) quatf[source]#
Return the rotation quaternion for Euler angles in radians and an axis sequence.
The rotations about axes
i,j, andkare applied in that order about the fixed axes (extrinsic), which is equivalent to applying them in the orderk,j,iabout the rotating axes (intrinsic). For example,quat_from_euler(e, 0, 1, 2)equalsquat_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, ande[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 fromi.k – Index of the third axis, in
{0, 1, 2}and different fromj.
- Returns:
Unit quaternion
qk * qj * qi, whereqiis the rotation ofe[i]about axisi, and similarly forqjandqk.- Return type: