While converting rotation matrix to angle-axis representation how to find axis of rotation when angle of rotation is Pi?

1.4k Views Asked by At

I have to convert a $3 \times 3$ rotation matrix into angle-axis representation.

Angle($\theta$) can be calculated using $tr (\mathbf{R}) = 1+2\cos{\theta}$ and vector $v$ corrresponding to the axis of rotation can be calculated using :

$v= {\dfrac {1}{2\sin(\theta)}}\begin{bmatrix} r_{32}-r_{23} \\ r_{13}-r_{31} \\ r_{21} -r_{12} \end{bmatrix}$ where $r_{ij}$ are appropriate entries of $R$ matrix.

The above representation for $v$ works fine when $0$ $<$ $\theta$ < $\pi$, but what method has to be applied when $\theta$ comes out to be $\pi$/-$\pi$

1

There are 1 best solutions below

0
On BEST ANSWER

Use Rodrigues formula for a rotation matrix $R$

$$R=I+\sin(\theta)S(v)+(1-\cos(\theta))S^2(v)$$

where $S(v)$ is a skew-symmetric matrix corresponding to the vector $v$

$$S(v)=\begin{bmatrix} 0 & -v_z & v_y \\ v_z & 0 & -v_x \\ -v_y & v_x & 0 \end{bmatrix}$$

You can check that relation $$S^2(v)=vv^T-I$$ holds ( $v$ has to be unit vector here)
and for $$\theta=\pi$$
we have very useful relation
$$R=I+2(vv^T-I)$$ and consequently $$vv^T=\dfrac{1}{2}(R+I) $$

The matrix $$vv^T=\begin{bmatrix} v_x^2 & v_y v_x& v_zv_x \\ v_xv_y & v_y^2& v_z v_y\\ v_x v_z & v_y v_z & v_z^2 \end{bmatrix}$$ allows to calculate $$v = [ v_x \ \ v_y \ \ v_z]^T $$ directly from obtained entries of the matrix (two solutions $R(v,\pi)=R(-v,\pi))$.