[Math] 3D rotation around arbitrary axis

linear algebrarotations

I have a 3D rotation matrix, R which is a combination of rotations around x-axis , y-axis and z-axis. I know how to calculate n(the arbitrary axis around which a point rotated about theta angle and this rotation is equal to rotating that point using the 3D matrix above) i.e. by finding the eigenvector of R corresponding to the eigenvalue equal to 1. How can I calculate theta, the angle to rotate about the arbitrary axis?

Best Answer

I'll describe a computational method, assuming the rotation has been translated to be around an axis through the origin.

If you know the axis of rotation $A=(a,b,c)$, then you can find a vector orthogonal to this one. For example, if $a \ne 0$, $b \ne 0$, then $V=(b,-a,0)$ is such a vector. Or, if one component is $0$--say, for example $c=0$, then $V=(0,0,1)$ is orthogonal. And that covers all cases.

A third vector in a right-handed triple is found using the vector cross product: $W=A\times V$. Normalize $V$ and $W$ to unit vectors $\hat{V}$, $\hat{W}$.

Now, feed $\hat{V}$ into your matrix and determine the output in terms of $\hat{V}$, $\hat{W}$ using dot products $$ R\hat{V} = \{(R\hat{V})\cdot\hat{V}\}\hat{V}+\{(R\hat{V})\cdot\hat{W}\}\hat{W}=\alpha\hat{V}+\beta\hat{W}, $$ and compare to the action of a right-handed rotation about $A$ through an angle $\theta$: $$ \hat{V} \mapsto \cos\theta \hat{V}+\sin\theta \hat{W}. $$

Related Question