# can't compute rotation from 3d rotation matrix just from eigenvalues and eigenvectors

Starting with a $3 \times 3$ rotation matrix $R$, I would like to know the axis and angle of rotation.

It seems like a popular topic for questions on this forum, but I can't quite find the answer to my question (see below).

I proceeded as follows but couldn't quite complete the task.

I know that $R$ has a real eigenvalue equal to $1$ and two complex eigenvalues of the form $e^{i \theta}, e^{-i \theta}$. Let $\mathbf{v}$ be an eigenvector with eigenvalue 1. Then $v$ determines the axis of rotation and the angle of rotation is $\theta$ or $-\theta$.

If we assume the right hand rule, then I believe that exactly one of these angles is correct, but which one? The answer changes as I negate my choice of eigenvector, so I'm thinking that there is another invariant of the matrix $R$ that I need to extract (besides the eigenvalues and eigenvectors).

For example, consider the rotation matrix $R = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}$. One choice of eigenvector is $\mathbf{v} = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}$. Relative to this choice, I think that most will agree, the angle of rotation is definitely $90^ \circ$ and not $-90^ \circ$. I'd like to make that determination for more general rotation matrices?

Any ideas?

• I can think of moving a the xyz reference frame into position for any rotation. That might do it. – CopyPasteIt Jun 3 '17 at 0:27
• I admit I was a little sloppy; $e^{i \theta}$ only determines $\theta$ up to an integer multiple of $2 \pi$. Still, $\theta$ and $-\theta$ generally differ by something else so my question is still valid. – sitiposit Jun 3 '17 at 0:40
• It’s meaningless to speak of the direction of the rotation without first defining an orientation, which is what you’re doing when you choose between $\mathbf v$.and $-\mathbf v$: a clockwise rotation about some axis looks exactly the same as a counterclockwise rotation when viewed from the opposite direction. There’s nothing intrinsic to the rotation matrix that will allow you to decide on the “correct” orientation. You’ll have to use external criteria to do that. This point has come up before, although I can’t find the relevant questions at the moment. – amd Jun 3 '17 at 0:40
• It seems to me that the question still stands. Assuming that I've chosen an eigenvector $\mathbf{v}$, how do I decide on the angle of rotation? – sitiposit Jun 3 '17 at 0:47
• @amd - I don't think you have to flip a coin. – T L Davis Jul 12 '17 at 23:34

I think I figured out a solution. Let $\mathbf{v}$ be any eigenvector of the rotation matrix $R$. Let $\mathbf{w}$ be any vector independent of $\mathbf{v}$. Let $\theta$ and $-\theta$ be the arguments of the complex eigenvalues of $R$.
The angle of rotation is the argument above with the same sign as $(\mathbf{w} \times R\mathbf{w}) \cdot \mathbf{v}$.
• This is a nice, simple, solution. Note that you can take for $\mathbf w$ one of the standard basis vectors (as long as it’s not the axis of rotation). Then $R\mathbf w$ is the corresponding column of $R$ and their cross product is a simple rearrangement with negation of the components of $R\mathbf w$. This lets you find the sign without having to apply the rotation or compute a cross product explicitly. – amd Jul 15 '17 at 3:08
• @amd This answer is not correct. $\mathbf{v}$ cannot be "any eigenvector of the rotation matrix $R$". It must be the axis of rotation, i.e. the eigenvector associated with the eigenvalue of 1. If $\mathbf{v}$ is the axis of rotation, then the solution works quite nicely per your comment. Perhaps I'm being too picky, but this is not a solution using "just the eigenvalues and eigenvectors". – T L Davis Jul 16 '17 at 5:07
• @TLDavis Good catch. $\mathbf v$ must indeed be an eigenvalue of $1$. I didn’t pay close enough attention to that. – amd Jul 16 '17 at 6:03