newton.utils.quat_from_euler#

newton.utils.quat_from_euler(e, i, j, k)[source]#

Convert Euler angles to a quaternion.

The integers i, j, k select axes in the set {0, 1, 2} that determine the Euler-sequence used. They must satisfy i j and j k. For example, the XYZ sequence corresponds to (0, 1, 2).

Parameters:
  • e (vec3f) – The Euler angles (in radians).

  • i (int) – The index of the first axis.

  • j (int) – The index of the second axis.

  • k (int) – The index of the third axis.

Returns:

The quaternion.

Return type:

quatf