Quaternion: Difference between revisions

Line 21: Line 21:
Slerp, or ''spherical linear interpolation'' is done as:
Slerp, or ''spherical linear interpolation'' is done as:
<math display="block">
<math display="block">
slerp(q_0, q_1, s) \equiv q(s)[q_0, q_1] = q_0 \frac{\sin((1-s)\phi)}{\sin \phi} + q_1 \frac{\sin(s\phi)}{\sin \phi}
\operatorname{slerp}(q_0, q_1, s) \equiv q(s)[q_0, q_1] = q_0 \frac{\sin((1-s)\phi)}{\sin \phi} + q_1 \frac{\sin(s\phi)}{\sin \phi}
</math>
</math>
Here <math>\phi</math> is the angle between the two quaternions: <math>\cos(\phi) = q_0 \cdot q_1</math>.
Here <math>\phi</math> is the angle between the two quaternions: <math>\cos(\phi) = q_0 \cdot q_1</math>.