# Expressing 3DoF Rotation

The pose of a rigid body is a 6-DOF quantity, consisting of translational position (3-DOF) and rotational position, or orientation (3-DOF). Translational position is straightforwardly expressed by a triplet (x, y, z). Rotational position, or orientation, is not so simple.

## Rotation Vector

Rotations, like translations, can be represented by a 3D vector. The rotation vector’s direction specifies the axis of rotation, while its length specifies the angle rotated about this axis (clockwise, looking along the vector). However, where translations can be combined simply by adding their vectors, rotations cannot. Or they can, but only if they are infinitesimal. With larger rotations, the vector space breaks down, because finite successive rotations interact, exhibiting not only non-linearity, but also non-commutativity. This makes rotation vectors a poor choice for expressing orientation in scenarios where the body may undergo successive rotations.

## Other Triplets

Euler Angles (including Tait-Bryan Angles) break down the rotation into three successive rotations about three particular axes. Like the the rotation vector they have no redundant variables, and therefore guaranteed consistency without the need for constraints. However, any such representation necessarily suffers from singularities/discontinuities (such as the “gimbal lock” problem). They are quite useless as a way of working with successive rotations, and are usually converted into one of the representations below before manipulation.

## Orthogonal Matrix

The rotation matrix does away with these problems by means of redundancy. A rotation matrix is a 3×3 orthogonal matrix that realizes the linear transformation that carries out the rotation in question. Equivalently, you can think of its columns as the three (orthonormal) standard basis vectors attached to the body’s frame, but viewed from the world’s frame of reference. The rotation matrix has 3 DOF because of its 9 elements minus 3 constraints of normality (to avoid stretching) minus 3 constraints of orthogonality (to avoid shearing).

The major advantage of the rotation matrix over triplet representations is that successive rotations are very easy to combine: Just multiply the matrices!

## Unit Quaternion

The quaternion representation achieves the same advantages as the matrix representation using only one redundant variable and constraint, rather than six. A quaternion is a quadruplet, but a rotation quaternion has one constraint, yielding the required 3-DOF system.

The quaternion is an extension of the complex number, and consists of a real scalar and an imaginary triplet. In a rotation quaternion, the imaginary triplet expresses the physical direction of the axis of rotation, but does not generally have unit magnitude. The constraint imposed on a rotation quaternion is that of unit magnitude for the quaternion as a whole. Therefore the rotation quaternion lies in the 4D unit hyper-sphere. The “north hyper-pole” on this hypersphere, at [1,(0,0,0)] represents 0° rotation, while the “south hyper-pole” at [-1, (0,0,0)] represents 360° rotation. Note that in these cases (only), the axis of rotation is irrelevant (and zero). Furthermore, these two rotations are identical. In fact, any two antipodal points on the hyper-sphere represent the same rotations (giving a “double cover”). As mentioned already, the imaginary triplet (like the rotation vector) has the physical direction of the axis of rotation. It remains only to specify the angle of rotation. The angle of rotation is given by the distance along the hyper-surface of the hyper-sphere from the north hyper-pole. A distance θ represents an angle 2θ in radians, so that by the time the south hyper-pole is reached, the angle has reached 360°, making the direction traveled irrelevant again (just like a traveler wishing to travel from the North Pole to the South Pole – the direction taken is irrelevant). Note, however, that unlike the 3D sphere’s surface, the 4D hyper-sphere’s hyper-surface is in fact a volume, and the “direction traveled” (axis of rotation) is specified by a triplet rather than a doublet.

From the visualization described above, a rotation quaternion can be determined from the corresponding rotation vector α**u** (where α is the angle of rotation and **u** is a unit vector/triplet defining the axis of rotation) by

cos(α/2) + **u** sin(α/2)

A successive rotation quaternion can be combined with its predecessor by left multiplication and right division, yielding slightly better efficiency than the rotation matrix, and better numerical properties. Quaternions also support efficient interpolation of orientations.

good job