2
$\begingroup$

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$

$\endgroup$
  • $\begingroup$ Welcome to MSE. Please read this text about how to ask a good question. $\endgroup$ – José Carlos Santos May 19 '18 at 14:57
  • $\begingroup$ I hope the edited version of the question is more clear :) $\endgroup$ – MSD May 19 '18 at 15:26
  • $\begingroup$ Yes. It is much better now. $\endgroup$ – José Carlos Santos May 19 '18 at 15:36
  • $\begingroup$ link The above link has a representation for rotation matrix which can be used for finding the angle-axis form when theta = pi , but I can't find a way to use it $\endgroup$ – MSD May 22 '18 at 4:03
  • $\begingroup$ @MSD I'm curious, something unclear MSD in my answer? $\endgroup$ – Widawensen May 30 '18 at 9:45
1
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.