# Calculating rotation axis from rotation matrix

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?

• Assuming you have confirmed that the rows of $\operatorname{adj}(A-I)$ are parallel - it's simple to work out that $\operatorname{adj}(A-I) = A + A^T + (1- \operatorname{tr}(A) )I$ using the formula here and simplifying by noting that $\operatorname{adj}(A) = A^T$. Now note that this is clearly a symmetric matrix, then recall that $M \operatorname{adj}(M) = \det(M) I$. But $\det(A-I) = 0$, since $1$ is an eigenvalue of $A$. Thus, $A \operatorname{adj}(A-I) = \operatorname{adj}(A-I)$, and the conclusion follows. – stochasticboy321 Dec 28 '16 at 5:01
• Thanks.If you just copy/paste into an answer, I will upvote. – bubba Dec 28 '16 at 11:54

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.

• Excellent answer. Thanks very much. I understand the formula that you derived in part #3. But I don't see why this formula tells us that the rows of this matrix are vectors that are parallel to the rotation axis. – bubba Jan 6 '17 at 0:43
• Also, in several places, you refer to "the plane generated by a matrix". What does this mean? If $A$ is a $3 \times 3$ matrix, what is the plane generated by $A$? Is it the set $\{x \in \mathbb{R}^3 : Ax = 0\}$ ? – bubba Jan 6 '17 at 0:46
• @bubba In3# the result is of the form $avv^T$ ($a$ is a scalar) where $vv^T$ is a projection matrix onto the line represented by the unit vector $v$ which is at the same time the vector representing the axis. The matrix additionally is symmetric so it doesn't matter whether columns or rows are considered as being parallel. Note also that $vv^Tv=v$. – Widawensen Jan 7 '17 at 8:23
• @bubba I mean by the phrase "the plane generated by a matrix" that columns (regarded as vectors) of this $A$ matrix are lying in the plane - matrix has rank 2- so the plane is a span of these vectors, and $Ax$ has also to lie in this plane. Note that from Rodrigues formula $R-I$ is such a matrix. We have $v^T (R-I)=[0 \ 0 \ 0]$ so the vector $v$ representing the axis of rotation is orthoghonal to all three columns of $R-I$ and consequently to the plane of $R-I$. Note also that we have $v^TS(v)=[ 0 \ 0 \ 0]$. – Widawensen Jan 7 '17 at 8:42
• @bubba .. and thank you Bubba for posting the question, I'm also collecting different things associated with 3d rotations and your question substantially extended my "collection" :) .... especially these adjugate matrices.. – Widawensen Jan 7 '17 at 8:49