In mathematics, the axis-angle representation of a rotation parameterizes a rotation in a three-dimensional Euclidean space by two quantities: a unit vector e indicating the direction of an axis of rotation, and an angle ? describing the magnitude of the rotation about the axis. Only two numbers, not three, are needed to define the direction of a unit vector e rooted at the origin because the magnitude of e is constrained. For example, the elevation and azimuth angles of e suffice to locate it in any particular Cartesian coordinate frame.
By Rodrigues' rotation formula, the angle and axis determine a transformation that rotates three-dimensional vectors. The rotation occurs in the sense prescribed by the right-hand rule. The rotation axis is sometimes called the Euler axis.
It is one of many rotation formalisms in three dimensions. The axis-angle representation is predicated on Euler's rotation theorem, which dictates 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, also called the Euler vector. In this case, both the rotation axis and the angle are represented by a vector codirectional with the rotation axis whose length is the rotation angle ?,
Note that many rotation vectors correspond to the same rotation. In particular, a rotation vector of length ? + 2?M, for any integer M, encodes exactly the same rotation as a rotation vector of length ?. Thus, there are at least a countable infinity of rotation vectors corresponding to any rotation. Furthermore, all rotations by 2?M are the same as no rotation at all, so, for a given integer M, all rotation vectors of length 2?M, in all directions, constitute a two-parameter uncountable infinity of rotation vectors encoding the same rotation as the zero vector. These facts must be taken into account when inverting the exponential map, that is, when finding a rotation vector that corresponds to a given rotation matrix. The exponential map is onto but not one-to-one.
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 rotate radians (or 90°) about the z axis. Viewing the axis-angle representation as an ordered pair, this would be
The above example can be represented as a rotation vector with a magnitude of pointing in the z direction,
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[clarification needed] and twists.
Plugging the three eigenvalues 1 and e±i? and their associated three orthogonal axes in a Cartesian representation into Mercer's theorem is a convenient construction of the Cartesian representation of the Rotation Matrix in three dimensions.
Rodrigues' rotation formula, named after Olinde Rodrigues, is an efficient algorithm for rotating a Euclidean vector, given a rotation axis and an angle of rotation. In other words, Rodrigues' formula provides an algorithm to compute the exponential map from (3) to SO(3) without computing the full matrix exponential.
If v is a vector in R3 and e is a unit vector rooted at the origin describing an axis of rotation about which v is rotated by an angle ?, Rodrigues' rotation formula to obtain the rotated vector is
For the rotation of a single vector it may be more efficient than converting e and ? into a rotation matrix to rotate the vector.
There are several ways to represent a rotation. It is useful to understand how different representations relate to one another, and how to convert between them. Here the unit vector is denoted ? instead of e.
Essentially, by using a Taylor expansion one derives a closed-form relation between these two representations. Given a unit vector ? ? (3) = R3 representing the unit rotation axis, and an angle, ? ? R, an equivalent rotation matrix R is given as follows, where K is the cross product matrix of ?, that is, Kv = ? × v for all vectors v ? R3,
Because K is skew-symmetric, and the sum of the squares of its above-diagonal entries is 1, the characteristic polynomial P(t) of K is P(t) = det(K - tI) = -(t3 + t). Since, by the Cayley-Hamilton theorem, P(K) = 0, this implies that
As a result, K4 = -K2, K5 = K, K6 = K2, K7 = -K.
This cyclic pattern continues indefinitely, and so all higher powers of K can be expressed in terms of K and K2. Thus, from the above equation, it follows that
Due to the existence of the above-mentioned exponential map, the unit vector ? representing the rotation axis, and the angle ? are sometimes called the exponential coordinates of the rotation matrix R.
Let K continue to denote the 3 × 3 matrix that effects the cross product with the rotation axis ?: K(v) = ? × v for all vectors v in what follows.
and then use that to find the normalized axis,
Note also that the Matrix logarithm of the rotation matrix R is
Given rotation matrices A and B,
is the geodesic distance on the 3D manifold of rotation matrices.
For small rotations, the above computation of ? may be numerically imprecise as the derivative of arccos goes to infinity as ? -> 0. In that case, the off-axis terms will actually provide better information about ? since, for small angles, R ? I + ?K. (This is because these are the first two terms of the Taylor series for exp(?K).)
This formulation also has numerical problems at ? = ?, where the off-axis terms do not give information about the rotation axis (which is still defined up to a sign ambiguity). In that case, we must reconsider the above formula.
At ? = ?, we have
and so let
so the diagonal terms of B are the squares of the elements of ? and the signs (up to sign ambiguity) can be determined from the signs of the off-axis terms of B.
Given a versor q = s + x represented with its scalar s and vector x, the axis-angle coordinates can be extracted using the following:
A more numerically stable expression of the rotation angle uses the atan2 function:
where || is the Euclidean norm of the 3-vector x.