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 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}$.