# Working With Rotations

Rotations in 3D space (which we will just call “rotations” in this article) are useful for many applications – physics engines, robotics, positioning…– as they can encode the orientation of a rigid body. However, they are also fickle: they do not belong to a vector space (i.e. the linear combination of rotations is not a rotation) and as such are known to not work correctly with a number of standard interpolation, integration or optimization algorithms.

A rotation is geometrically described by its axis and the scalar angle around this axis, so it has three degrees of freedom: two for the direction of the axis and one for the angle. If rotations did form a vector space, there would exist an ideal parameterization (a minimal set of parameters) to describe them in ℝ³, with a differentiable bijection mapping each rotation to a single choice of parameter values. As this is not the case, however, parameterization must be chosen carefully depending on the application, with a necessary trade-off between:

- Redundancy – having more than three parameters, which adds complexity, since parameters must now follow certain constraints;
- The risk of encountering singularity – having several possible sets of parameters map to the same rotation, which causes calculations to fail.

One can usually choose the right rotation parameterization for a given application by answering these three questions:

- Can singularity be avoided for this application? This is usually possible if the problem at hand only spans a subset of all rotations, or if it can be reexpressed to do so with a change of variables.
- Is it possible to easily enforce constraints on rotation parameters in the target algorithm?
- Is the parameter set computationally efficient for the elementary operations that will be performed on the rotations? Different parameter sets perform differently whether performing composition, integration, Jacobian computations for optimization, or rotating a vector.

The most widely used parameterizations are 3×3 matrices with orthonormality constraints, Euler angles and unitary quaternions, but several others exist. While some alternatives are merely mathematical curiosities, others, such as exponential coordinates and modified Rodrigues parameters (MRPs) can be very useful for specific applications. These parameterizations are compared in the chart below.

For a more in-depth exploration of this topic, please have a look at our white paper here: Working With Rotations.