next up previous contents
Next: Euler angles Up: Rotation matrices Previous: Rotation matrices   Contents

Angle and axis

In three dimensions, a rotation is defined by a $3 \times 3$ orthogonal matrix with positive determinant. In general, such matrices have the real eigenvalue 1 together with two complex conjugate eigenvalues $e^{\pm i
\theta}$, wherein $\theta$ is the angle of rotation. In turn, there is a real eigenvector lying along the axis of rotation and two complex conjugate null eigenvectors defining the plane of rotation.

However, an orthogonal matrix is also the exponential of a real antisymmetric matrix, having the same eigenvectors but with eigenvalues $0, i \theta$, and $- i \theta$. Three such matrices,

\begin{eqnarray*}
\Sigma_x & = & \left[ \begin{array}{ccc}
0 & -1 & 0 \\
1 &...
... 0 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & -1
\end{array} \right]
\end{eqnarray*}



form a basis for all the $3 \times 3$ antisymetric matrices, and are a convenient basis for a Lie Algebra as well. It results that the matrix 0.4em

\begin{eqnarray*}
O & = & e^{\theta (\alpha \Sigma_x
+ \beta \Sigma_y + \gamm...
...beta &
\cos\theta+(1-\cos\theta)\gamma^2
\end{array} \right]
\end{eqnarray*}



rotates vectors through the angle $\theta$ about an axis whose direction cosines are ( $\alpha, \beta, \gamma)$. This gives the angle-axis parameterization of a rotation.

Its axis and angle can be recovered by inspection from a rotation matrix. The direction cosines of the axis are proportional to the coefficients of the three antisymmetric matrices $\Sigma_x$, $\Sigma_y$, and $\Sigma_z$, whereas the angle of rotation is related to the trace via

\begin{eqnarray*}
Tr(e^{\theta\Sigma}) & = & 1 + 2 \cos \theta.
\end{eqnarray*}



Figure: Objective-C panel from which Euler angles may be defined
\begin{figure}\begin{picture}(250,200)(15,0)
\epsffile{fig6.eps}\end{picture}\end{figure}

 
/* sphax - generate rotation from axis and angle */

void sphax(o,th,a,b,c) double o[][3], th, a, b, c; {
double ca, cb, cc, ct, tt, st, r, t;
r=sqrt(a*a+b*b+c*c);
t=(th*3.14159)/180.0;
ca=a/r; cb=b/r; cc=c/r;
ct=cos(t); st=sin(t); tt=1.0-ct;
o[0][0]= ct+tt*ca*ca;
o[0][1]= cc*st+tt*ca*cb;
o[0][2]=-cb*st+tt*ca*cc;
o[1][0]=-cc*st+tt*ca*cb;
o[1][1]= ct+tt*cb*cb;
o[1][2]= ca*st+tt*cb*cc;
o[2][0]= cb*st+tt*ca*cb;
o[2][1]=-ca*st+tt*cb*cc;
o[2][2]= ct+tt*cc*cc;
}


next up previous contents
Next: Euler angles Up: Rotation matrices Previous: Rotation matrices   Contents
Pedro Hernandez 2004-05-13