shz_quat_to_angles_yxz
SHZ_INLINE shz_vec3_t shz_quat_to_angles_yxz(shz_quat_t q) SHZ_NOEXCEPT;Decomposes the given quaternion into Y, X, then Z Tait-Bryan angles.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
q | shz_quat_t | Unit quaternion to decompose. |
Returns
Section titled “Returns”The Y, X, and Z angles of rotation, in radians.
Details
Section titled “Details”Returns the angles a, b, and c, in radians, such that the given quaternion is equal to Qy(a) * Qx(b) * Qz(c), making this the inverse of shz_quat_from_rotation_yxz(). The angles are returned in the same order as that routine takes them: x = Y angle, y = X angle, z = Z angle.
The outer angles are in [-PI, PI] and the middle angle is in [-PI/2, PI/2].
- At gimbal lock, when the middle angle is +/-PI/2, the outer angles are not unique. The returned angles still reconstruct the same rotation.
Availability
Section titled “Availability”- C++ equivalent:
shz::quat::to_angles_yxz - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_quat.h:245 - Module: Quaternion, section "Properties"