newton.core.quat_to_euler#

newton.core.quat_to_euler(q, i, j, k)[source]#

Convert a quaternion into Euler angles.

\(i, j, k\) are the indices in \([0, 1, 2]\) of the axes to use (\(i \neq j, j \neq k\)).

Reference: https://doi.org/10.1371/journal.pone.0276302

Parameters:
  • q (quat) – The quaternion to convert

  • 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 Euler angles (in radians)

Return type:

vec3