Unit content
Interpolating orientations with quaternions
Interpolating three-dimensional orientations is not the same as independently interpolating three Euler angles. The space of rotations is curved, and naive angle interpolation can take an unexpected path or cross a coordinate singularity.
Unit quaternions lie on a sphere
A unit quaternion
$$q=(w,x,y,z)$$
has four components satisfying
$$w^2+x^2+y^2+z^2=1,$$
so unit quaternions lie on the three-dimensional unit sphere in four-dimensional space.
Shortest representation
Because $q$ and $-q$ represent the same physical orientation, interpolation should choose the pair of quaternion representatives lying on the shorter arc between orientations.
Spherical linear interpolation
SLERP interpolates along a great-circle arc at constant angular rate. For appropriately chosen unit quaternions $q_0$ and $q_1$ separated by angle $\Omega$,
$$\operatorname{slerp}(q_0,q_1;t) =\frac{\sin((1-t)\Omega)}{\sin\Omega}q_0 +\frac{\sin(t\Omega)}{\sin\Omega}q_1.$$
Practical interpolation
For orientations that are already very close, normalized linear interpolation can be a useful approximation. For larger angular changes, spherical interpolation preserves the geometry of unit quaternions more faithfully.
Quaternion interpolation is widely used in animation, robotics and attitude estimation because it produces smooth paths through orientation space.