Sign in to follow this  
erik rostock

get original rotation from rotation matrix around 3 axes

Recommended Posts

Hello, I have a rotation matrix that represents the rotation around the x,y and z axes: [IMG]http://picfront.de/d/tZKdqw89o/matrix_42.gif[IMG] I know all fields of the output matrix, unfortunately not the original angles. (The variables x,y,z in the image represent the angles around the respective axis , not any vectors) Is it possible to get the original angles just from this matrix? Thanks for your help in advance :) erik

Share this post


Link to post
Share on other sites
Quote:
Original post by erik rostock
Hello,
I have a rotation matrix that represents the rotation around the x,y and z axes:
[IMG]http://picfront.de/d/tZKdqw89o/matrix_42.gif[IMG]
I know all fields of the output matrix, unfortunately not the original angles. (The variables x,y,z in the image represent the angles around the respective axis , not any vectors)

Is it possible to get the original angles just from this matrix?
Thanks for your help in advance :)
erik
What you have there is a rotation matrix that's been built from a set of three Euler angles, and yes, you can get the angles (or an equivalent set of angles) back.

What you're looking for is a matrix-to-Euler conversion. How to do this is pretty well documented online, but unfortunately, due to the varying conventions involved (vector notation, axis order, even matrix 'majorness', if you're looking at a code sample that uses 1-d indexing), it can be difficult to find an example that will work 'out of the box'.

One other thing to keep in mind is that even if the angles returned are correct, they may not be the same as the angles used to build the matrix (due to aliasing).

Finally, the usual question: if you have the matrix, why do you need the Euler angles?

Share this post


Link to post
Share on other sites
What do you mean with:
-> they may not be the same as the angles used to build the matrix (due to aliasing).
?
What I expect is that it won't be possible to get the angles, as sin(0.4PI) = sin(0.6PI) for example ... and so on.

Share this post


Link to post
Share on other sites
Quote:
Original post by erik rostock
What do you mean with:
-> they may not be the same as the angles used to build the matrix (due to aliasing).
?
What I expect is that it won't be possible to get the angles, as sin(0.4PI) = sin(0.6PI) for example ... and so on.
What I mean by 'aliasing' in this context is that more than one set of Euler angles can represent the same orientation. Because of this, if you build a matrix from a set of Euler angles, and then extract a set of Euler angles from the matrix, the extracted angles may be different than the original angles. However, this doesn't mean the extracted angles are incorrect; they're just another way of representing the orientation in question.

In other words, even though you may not be able to get the exact angles that were used to build the matrix back, you can most certainly extract a valid set of Euler angles from the matrix.

The question remains though: what do you need the Euler angles for?

Share this post


Link to post
Share on other sites
Okay, the angles I get will fulfill my needs, it was just a question I had, thinking about that topic.
Actually, I am testing the POSIT algorithm, which calculates an object translation and rotation if you know 3 points of an objects local coordinate system and their current coordinates on the camera plane.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this