What conventions does rotm2eul rely on?

Hi,
does the function rotm2eul(rotm,'zyz') generate euler angles for an extrinsic or intrinsic rotation? I assume that the righthanded convention for angles is used. Is this assumption correct?
Moreover, is the extraction of three euler angles from the rotation matrix rotm unique? I know that the uniqueness of euler angles can be achieved by limiting the range of alpha, beta and gamma. Does rotm2eul take this into account or just provides me with one possible solution.
Thank you very much.

4 commentaires

Vladislav
Vladislav le 28 Mar 2024
Got exactly the same question! Would be helpful to have an answer!
David Goodmanson
David Goodmanson le 29 Mar 2024
Modifié(e) : David Goodmanson le 22 Déc 2025
Hi JS,
I don't have any of the toolboxes containing rotm2eul or eul2rotm but it should be fairly easy to find out the convention with some experimentation. And it's kind of fun to explore. I think it's safe to assume that the coordinate system is right handed. Under the convention that postive angles rotate an object in the counterclockwise direction when the axis of rotation is coming up out of the page, three rotation matrices are shown below.
Rotation matrices operate from the left on column vectors
w' = R*w
If you create a rotation matrix with known euler angles, for example
theta_x = .2*pi;
theta_y = .3*pi;
theta_z = .4*pi;
cx = cos(theta_x); sx = sin(theta_x);
cy = cos(theta_y); sy = sin(theta_y);
cz = cos(theta_z); sz = sin(theta_z);
Rx = [1 0 0
0 cx -sx
0 sx cx];
Ry = [cy 0 sy
0 1 0
-sy 0 cy];
Rz = [cz -sz 0
sz cz 0
0 0 1];
and then do
Rmat = Rx*Ry*Rz; % known euler angles
eulerangles = rotm2eul(Rmat,'xyz')
either you will get back 0.2, 0.3, 0.4 or you won't. If you do, great. If not, there are not that many alternatives to check:
[1] In rotm2eul, use 'zyx' instead of 'xyz'. [2] All angles get replaced by their negatives. Equivalently, the angle stays the same but s and -s change places in the definition of the rotation matrix. [3] do both [1]& [2]. which is extrinsic<---> intrinsic. If none of those work there is the possibililty that not all angles change sign and only one or two of them do. This I think is less likely although of course it can be checked.
Matt
Matt le 15 Déc 2025
Removing the multiplication by pi from theta in the example above will indeed cause the rotm2eul function to return 0.2, 0.3, and 0.4
David Goodmanson
David Goodmanson le 22 Déc 2025
Modifié(e) : David Goodmanson le 28 Déc 2025
Hi Matt, thanks for posting that. Good to know that what seemed to be the most likely possiblity was the correct one.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Interactions, Camera Views, and Lighting dans Centre d'aide et File Exchange

Question posée :

JS
le 9 Avr 2016

Community Treasure Hunt

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

Start Hunting!

Translated by