Axis-angle representation

The axis-angle representation of a rotation, also known as the exponential coordinates of a rotation, parameterizes a rotation by two values: a unit vector indicating the direction of a directed axis (straight line), and an angle describing the magnitude of the rotation about the axis. The rotation occurs in the sense prescribed by the right-hand rule.

This representation evolves from Euler's rotation theorem, which implies that any rotation or sequence of rotations of a rigid body in a three-dimensional space is equivalent to a pure rotation about a single fixed axis.

The axis-angle representation is equivalent to the more concise rotation vector, or Euler vector representation. In this case, both the axis and the angle are represented by a non-normalized vector codirectional with the axis whose magnitude is the rotation angle.

Rodrigues' rotation formula can be used to apply to a vector a rotation represented by an axis and an angle.

Contents

Uses

The axis-angle representation is convenient when dealing with rigid body dynamics. It is useful to both characterize rotations, and also for converting between different representations of rigid body motion, such as homogeneous transformations and twists.

Example

Say you are standing on the ground and you pick the direction of gravity to be the negative z direction. Then if you turn to your left, you will travel \tfrac{\pi}{2} radians (or 90 degrees) about the z axis. In axis-angle representation, this would be

\langle \mathrm{axis}, \mathrm{angle} \rangle = \left( \begin{bmatrix} a_x \\ a_y \\ a_z \end{bmatrix},\theta \right) = \left( \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix},\frac{\pi}{2}\right)

This can be represented as a rotation vector with a magnitude of \tfrac{\pi}{2} pointing in the z direction.

\begin{bmatrix} 0 \\ 0 \\ \frac{\pi}{2} \end{bmatrix}

Rotating a vector

Rodrigues' rotation formula (named after Olinde Rodrigues) is an efficient algorithm for rotating a vector in space, given a rotation axis and an angle of rotation. In other words, the Rodrigues formula provides an algorithm to compute the exponential map from so(3) to SO(3) without computing the full matrix exponent (the rotation matrix).

If v is a vector in \mathbb{R}^3 and ω is a unit vector describing an axis of rotation about which we want to rotate v by an angle θ (in a right-handed sense), the Rodrigues formula to obtain the rotated vector is:


\mathbf{v}_\mathrm{rot} = \mathbf{v} \cos\theta %2B (\mathbf{\omega} \times \mathbf{v})\sin\theta
  %2B \mathbf{\omega} (\mathbf{\omega} \cdot \mathbf{v}) (1 - \cos\theta).

This is more efficient than converting ω and θ into a rotation matrix, and using the rotation matrix to compute the rotated vector.

Relationship to other representations

There are many ways to represent a rotation. It is useful to understand how different representations relate to one another, and how to convert between them.

Exponential map from so(3) to SO(3)

The exponential map is used as a transformation from axis-angle representation of rotations to rotation matrices.

\exp\colon so(3) \to SO(3)

Essentially, by using a Taylor expansion you can derive a closed form relationship between these two representations. Given an axis,  \omega \in \Bbb{R}^{3} having length 1, and an angle,  \theta \in \Bbb{R}, an equivalent rotation matrix is given by the following:

R = \exp(\hat{\omega} \theta) = \sum_{k=0}^\infty\frac{(\hat{\omega}\theta)^k}{k!} = I %2B \hat{\omega} \theta %2B \frac{1}{2}(\hat{\omega}\theta)^2 %2B \frac{1}{6}(\hat{\omega}\theta)^3 %2B \cdots
R = I %2B \hat{\omega}\left(\theta - \frac{\theta^3}{3!} %2B \frac{\theta^5}{5!} - \cdots\right) %2B \hat{\omega}^2 \left(\frac{\theta^2}{2!} - \frac{\theta^4}{4!}  %2B \frac{\theta^6}{6!} - \cdots\right)
R = I %2B \hat{\omega} \sin(\theta) %2B \hat{\omega}^2 (1-\cos(\theta))

where R is a 3x3 rotation matrix and the hat operator gives the antisymmetric matrix equivalent of the cross product. This can be easily derived from Rodrigues' rotation formula.

Log map from SO(3) to so(3)

To retrieve the axis-angle representation of a rotation matrix calculate the angle of rotation:

 \theta = \arccos\left( \frac{\mathrm{trace}(R) - 1}{2} \right)

and then use it to find the normalized axis:

 \omega = \frac{1}{2 \sin(\theta)} \begin{bmatrix} R(3,2)-R(2,3) \\ R(1,3)-R(3,1) \\ R(2,1)-R(1,2) \end{bmatrix}

Note, also that the Matrix logarithm of the rotation matrix R is:

 \log R = \left\{ \begin{matrix}
0 & \mathrm{if} \; \theta = 0 \\
\frac{1}{2 \sin(\theta)} (R - R^\top) & \mathrm{if} \; \theta \ne 0 \; \mathrm{and} \; \theta \in (-\pi, \pi)
  \end{matrix}\right.

Except when R has eigenvalues equal to -1 where the log is not unique. However, even in the case where  \theta = \pi the Frobenius norm of the log is:

 \| \log(R) \|_F = \sqrt{2} | \theta |

Note that given rotation matrices A and B:

 d_g(A,B)�:= \| \log(A^\top B)\|_F

is the geodesic distance on the 3D manifold of rotation matrices.

Unit Quaternions

To transform from axis-angle coordinates to unit quaternions use the following expression:

Q = \left(\cos\left(\frac{\theta}{2}\right),  \omega \sin\left(\frac{\theta}{2}\right)\right)

Given a unit quaternion, the axis-angle coordinates can be extracted using the following:

\theta = 2\,\arccos(q_0)\,
\omega =
\left\{
  \begin{matrix}
    \frac{q}{ \sin( \theta/2 ) }
     , & \mathrm{if} \; \theta \neq 0 \\ 
    0, & \mathrm{otherwise}
  \end{matrix}
\right.

It may also be useful to know:

\frac{q}{ \sin( \theta/2 ) } =
\frac{[q_1 q_2 q_3]^\top}{ \|{[q_1 q_2 q_3]^\top}\|}

Simultaneous orthogonal rotations angle

Multiplying the rotation axis and angle gives vector SORA:


\mathbf{\Phi}=\begin{bmatrix} a_x \\ a_y \\ a_z \end{bmatrix}\theta=\begin{bmatrix} \theta_x \\ \theta_y \\ \theta_z \end{bmatrix}

where \theta_x, \theta_y, and \theta_z represent angles of three simultaneous rotations around orthogonal axes. It holds:


\theta=\sqrt{\theta_x^2%2B\theta_y^2%2B\theta_z^2}.

and


\mathbf{a}=\begin{bmatrix} a_x \\ a_y \\ a_z \end{bmatrix}=\frac{1}{\sqrt{\theta_x^2%2B\theta_y^2%2B\theta_z^2}}\begin{bmatrix} \theta_x \\ \theta_y \\ \theta_z \end{bmatrix}.

See also