Obtaining angles of rotation from a rotation Matrix

Started by
16 comments, last by ThrillKillKult 21 years, 11 months ago
quote:Looking at the original post he is talking about rotations about multiple axes and not a single axis. It seems like the eigen vector approach wouldn't work then since there may be no real eigen values.


Uhh, no. The eigenvector approach works perfectly. Absolutley *any* rotation matrix in 3-space has exactly one real eigenvalue and two complex ones, and the real one *always* is associated with the axis of rotation. That's right, *the one and only* axis of rotation. Any 3D rotation, no matter what Euler angles it is composed of is really just a rotation about one axis, x = (x1, x2, x3). This is not necesarily a coordinate system axis.

Recall that an eigenvector x, is the solution to:
A * x = alpha * x, A matrix, x vector, alpha scalar

You can easily see from this, that the eigenvector with real alpha (the eigenvalue) will be a vector that does not change direction when multiplied by a matrix. For rotation matrices, it is easy to see that the only vectors that do this are those along the axis.



[edited by - MisterAnderson42 on May 6, 2002 4:40:35 PM]
Advertisement
Well, except for rotations of 180 degrees around an axis you seem to be right. I suppose those are technically reflections. So given an axis of rotation how would you find the rotation? Find the angle between the orthogonal component of a vector before and after rotation? Then if you want a rotation about the x, y and then z axis that angle would be your rotation about the x-axis wouldn''t it? Infinite number of ways to get from point a to b aside. Your other two angles would be the angles needed to bring the x-axis to the direction of the eigen vector. As far as selecting an eigen vector it seems like you could use the cross product of the before and after vectors you used for finding the rotation angle. It seems like that would solve the +/- angle problem. Reversing your axis of rotation would reverse the angle wouldn''t it?
Keys to success: Ability, ambition and opportunity.
quote:Well, except for rotations of 180 degrees around an axis you seem to be right. I suppose those are technically reflections.

A 180 degree rotation is not a reflection.

And what MisterAnderson said is correct, for any rotation matrix there is exactly one axis of rotation. There may be several rotation axes which would take point A to point B but a matrix acts on all points.

I have been taking the pure mathematical approach. This algorithm goes as follows:

find the real eigenvalue of U, a 3x3 rotation (or upper 3x3 of a homogenous transformation)

solve U - transpose(U) = 2 * sin(alpha) * A
where A =
[0 -a3 a2]
[a3 0 -a1]
[-a2 a1 0]

and (a1, a2, a3) is the real eigenvector (axis of rotation).

quote:As far as selecting an eigen vector it seems like you could use the cross product of the before and after vectors you used for finding the rotation angle


Yes, this would work in most cases. One must take care with this method not to choose a test vector too close to the axis, as this will produce inaccurate results. (of course, choosing the axis exactly will give back an axis of 0,0,0, but this can be checked for).

As far as factoring rotation matrices into XYZ Euler angles goes, there are many methods. I have offered an alternative solution because Euler angles are evil. Dave Eberly goes over this in 3d Game Engine Design, and I''m sure the method is available elswhere on the net. Consequently, Eberly also covers a method for extracting the axis-angle rotation from a matrix. He does not derive the result there, and I do not understand where it comes from.
The logic for saying it is a reflection is that a rotation of 180 degrees around an axis is equivalent to a refection across two orthogonal planes whose intersection is the axis of rotation. Alternatively it is a reflection across a line. The point was that it was a special case where you get more than one real eigen value. I personally have no problem with saying that is not a rotation matrix. I also have no problem saying that rotation by 360 degrees around an axis is not a rotation since it is the identity matrix. If you want to say the identity matrix is a rotation matrix that is fine by me too.
Keys to success: Ability, ambition and opportunity.
A rotation about 3 axes is equivalent to a rotation about 1 axis. When you compose several rotations, you end up with another rotation. This is why it is convenient and intuitive to look at one eigenvector.
quote:The logic for saying it is a reflection is that a rotation of 180 degrees around an axis is equivalent to a refection across two orthogonal planes whose intersection is the axis of rotation


OK. That''s 2 reflections.

quote:The point was that it was a special case where you get more than one real eigen value.


Then the axis of rotation is the eigenvector associated with the eigenvalue 1. In your 180 degree rotations there are two eigenvalues which are -1 (the complex conjugate pair). What MisterAnderson was saying is still true, you discard this pair and the remaining real one corresponds to the rotation axis.
But it is one reflection across the axis of rotation I wasn''t arguing I''m right, just explaining why I said it. This is the point where I give up and go away. Bye.
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement