[Math] Calculating rotation axis from rotation matrix

linear algebralinear-transformationsmatricesrotations

Suppose we are given a rotation matrix, i.e. an orthogonal $3 \times 3$ matrix $\mathbf{A} = (a_{ij})$ with $\det \mathbf{A} = 1$. Then the mapping $\mathbf{x} \mapsto \mathbf{A}\mathbf{x}$ will rotate points of $\mathbb{R}^3$ around some axis through the origin. I have some old notes (which I wrote decades ago) that say that the axis of rotation can be obtained in several ways:

  1. As an eigenvector of $\mathbf{A}$ corresponding to the eigenvalue $1$.
  2. As the vector $(a_{32} – a_{23}, \; a_{13} – a_{31}, \; a_{21} – a_{12})$
  3. As any row of the matrix $\mathbf{A} + \mathbf{A}^T + [1 – \text{trace}(\mathbf{A})]\mathbf{I}$.
  4. As any row of the matrix $\text{adj}\,(\mathbf{A} – \mathbf{I})$. The rows of this matrix are all scalar multiples of one another, so it doesn't matter which row we use.
  5. As the cross product of the first two columns of the matrix $\mathbf{A} – \mathbf{I}$. This will actually be the third row of $\text{adj}\,(\mathbf{A} – \mathbf{I})$.

I want to confirm all of these statements. Clearly #1 is obvious, and #2 is well-known, but I'm having trouble with the other three. It's possible that they're not even true. Can someone elucidate, please. In your answer, it's OK to assume that #1 and #2 are already known.

Also, any thoughts on which calculations are most stable, numerically?

Best Answer

I will try to answer the question with a use of Rodrigues formula.

Introduction
I denote $A$ as $R(v,\theta)$ and your formulas as #2, #3, #4, #5. (#1 is the most general case but not considered below)

  • We have $R(v,\theta)= I+\sin(\theta)S(v)+(1-\cos(\theta))S^2(v)$ where $v$ is a unit vector representing the axis of rotation.
  • $S(v)=\begin{bmatrix}v\times{i} & v\times{j} & v\times{k}\end{bmatrix}$ is a skew-symmetric matrix which generates the plane orthogonal to $v$ ( plane of rotation). The matrix is always of rank $2$.
  • Appropriately $S^2(v)=\begin{bmatrix}v\times(v\times{i}) & v\times( v\times{j}) & v\times(v\times{k})\end{bmatrix}$ generates also the same plane. $S^2(v)=R(v,{\pi}/2)S(v)$. This matrix is symmetrical one, equal to $vv^T-I$.

Rotation matrix can be decomposed into symmetric and skew-symmetric part i.e. $R=\dfrac{R+R^T}{2} +\dfrac{ R-R^T}{2}=(I+(1-\cos(\theta))S^2(v)) \ + \ \sin(\theta)S(v)$

After this introduction let's go to your formulas.

2

From the skew-symmetric part we can directly obtain formula #2, but as we see it is a restriction here: formula is valid only for $sin(\theta)\neq{0}$, for $\theta = \pi$ can't be used, in this case symmetric part of Rodrigues formula has to be used in order to calculate axis.

3

From symmetric part of $R$ we can obtain $tr(R)= 1+2\cos(\theta)$ so the formula #3 has a form $R+R^T+(1-trace(R))I=2I+2I(1-\cos\theta)s^2(v)+(1-1-2cos\theta)I=2I(1-\cos\theta)+2I(1-\cos\theta)S^2(v)=2 (1-\cos\theta)(S^2(v)+I)=2 (1-\cos\theta)vv^T $ what is clearly what needed. We see that the matrix is symmetric so we can take both rows or columns for calculations.

4

because in this case $\text{adj}(R-I)(R-I)=0$ so $\text{adj}(R-I)((1-\cos(\theta))S^2(v))+\sin(\theta)S(v))=0$ what gives orthogonality of rows to the plane of $S(v)$ (assuming rows are non-zero vectors, for some cases two rows might be zero vectors)

5

as columns of $R-I$ are vectors lying in the plane of $S(v)$ so their cross product (if non-zero) must be orthogonal to it.

Related Question