Slerp - Quaternion Slerp

Quaternion Slerp

When Slerp is applied to unit quaternions, the quaternion path maps to a path through 3D rotations in a standard way. The effect is a rotation with uniform angular velocity around a fixed rotation axis. When the initial end point is the identity quaternion, Slerp gives a segment of a one-parameter subgroup of both the Lie group of 3D rotations, SO(3), and its universal covering group of unit quaternions, S3. Slerp gives a straightest and shortest path between its quaternion end points, and maps to a rotation through an angle of 2Ω. However, because the covering is double (q and −q map to the same rotation), the rotation path may turn either the "short way" (less than 180°) or the "long way" (more than 180°). Long paths can be prevented by negating one end if the dot product, cos Ω, is negative, thus ensuring that −90° ≤ Ω ≤ 90°.

Slerp also has expressions in terms of quaternion algebra, all using exponentiation. Real powers of a quaternion are defined in terms of the quaternion exponential function, written as eq and given by the power series equally familiar from calculus, complex analysis and matrix algebra:

Writing a unit quaternion q in versor form, cos Ω + v sin Ω, with v a unit 3-vector, and noting that the quaternion square v2 equals −1 (implying a quaternion version of Euler's formula), we have ev Ω = q, and qt = cos t Ω + v sin t Ω. The identification of interest is q = q1q0−1, so that the real part of q is cos Ω, the same as the geometric dot product used above. Here are four equivalent quaternion expressions for Slerp.


\begin{align}
\mathrm{Slerp}(q_0, q_1; t) & = q_0 (q_0^{-1} q_1)^t \\
& = q_1 (q_1^{-1} q_0)^{1-t} \\
& = (q_0 q_1^{-1})^{1-t} q_1 \\
& = (q_1 q_0^{-1})^t q_0
\end{align}

The derivative of Slerp(q0, q1; t) with respect to t, assuming the ends are fixed, is log(q1q0−1) times the function value, where the quaternion natural logarithm in this case yields half the 3D angular velocity vector. The initial tangent vector is parallel transported to each tangent along the curve; thus the curve is, indeed, a geodesic.

In the tangent space at any point on a quaternion Slerp curve, the inverse of the exponential map transforms the curve into a line segment. Slerp curves not extending through a point fail to transform into lines in that point's tangent space.

Quaternion Slerps are commonly used to construct smooth animation curves by mimicking affine constructions like the de Casteljau algorithm for Bézier curves. Since the sphere is not an affine space, familiar properties of affine constructions may fail, though the constructed curves may otherwise be entirely satisfactory. For example, the de Casteljau algorithm may be used to split a curve in affine space; this does not work on a sphere.

The two-valued Slerp can be extended to interpolate among many unit quaternions, but the extension loses the fixed execution-time of the Slerp algorithm.

Read more about this topic:  Slerp