File Exchange

image thumbnail

Quaternions to Euler angles conversion

version 1.0.1 (1.32 KB) by J Chen
Convert quaternions to Euler angles using Z-Y-X rotation sequence


Updated 14 Apr 2020

GitHub view license on GitHub

Convert quaternions to Euler angles. Note that the Euler angles are different for different rotation sequence. The Euler angles rotation sequence used in this code is z-y'-x'' (yaw, pitch, roll). The rotation is intrinsic, i.e., rotates along new axes. This definition is widely used by aerospace engineers.


Note that quaternions to Euler is not unique but Euler to quaternions is unique. So it is better to get the Euler of a normalized quaternions (such as [ 0.7071068, 0, 0.7071068, 0]) from the function and use the verification tool to convert the Euler to quaternions. The quaternions should match if the rotation sequence is correctly chosen.

Cite As

J Chen (2020). Quaternions to Euler angles conversion (, GitHub. Retrieved .

Comments and Ratings (0)



Modify description

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux