File Exchange

image thumbnail

Find Euler Angles

version (13.7 KB) by Dmitry Savransky
An interactive demo for learning and visualizing 3D coordinate transformations and Euler angles.


Updated 05 May 2011

View License

findEulerAngs generates Euler angle sets and animates rotations in response to user manipulation of a 3D rigid body (a box).

Use the mouse to change the orientation of the box. A wireframe of the original box position will appear. The 'Euler Axis' button animates the rotation about the Euler Axis between the original and
new box positions. The 'Rotate' button calculates a set of Euler angles for the rotation type currently selected ('Body' or 'Space') and the axis set selected in the dropdown menu to orient the axes to
the new box position. 'Derotate' reverses this process and brings the axes back to their previous position.
Once the axes have been rotated, subsequent rotations are calculated
from this new orientation. This means that Space rotations use the coordinate system associated with the previous cube orientation (i.e. the axes of the wireframe cube). 'Axes DCM' is the direction cosine matrix of the current axes orientation in the unrotated inertial frame. 'Box DCM (inertial)'
is the DCM of the box's current orientation in the unrotated inertial frame. 'Box DCM (Axes)' is the matrix product of the previous two DCMs. The Euler axis is calculated in the unrotated inertial frame.

Cite As

Dmitry Savransky (2021). Find Euler Angles (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)


Benjamin Terry

Excellent teaching aid. Thank you!!

Sharanya Srinivas

Hello Dmitry,

In your code you reference to 'DCMs from Kane & Levinson'. Could you please clarify if you are referring to a book or a paper and what part of it can be helpful.



Based on earlier comment on your other program for euler angles, it would be nice if there was a text box to type in angles



My sincere apologies to Dmitry - like many older version MATLAB users I had no knowledge of the new unused argument syntax. I have made the necessary mods and the code runs. I have already found the visualisation extremely useful for Euler angle manipulations and thank the author for this 5 star contribution to the file exchange.


Dmitry Savransky

This submission uses the 'unused argument syntax' introduced in R2009b. (see: ) Users of earlier versions will most likely encounter errors. You can fix these quite easily by replacing the tildes in various subfunction syntax declarations with dummy variables. I apologize to all pre-R2009b users for the inconvenience.


Looks like a potentially good piece of work spoilt by a lack of basic testing - the author should follow his own instructions to find the code simply doesn't run - crashing due to 'reserved' function arguments in call-back functions using the '~' symbol. Please correct this - the end result could be worth 5 stars!

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!