SLERP
SLERP means Spherical Linear Interpolation.
It is used to smoothly move from one orientation quaternion to another.
SLERP is useful when you want a rotation to move smoothly and at a steady angular speed.
Common uses:
- robot attitude interpolation
- drone or gimbal motion
- camera orientation animation
- animation between two poses
Interactive demo
Move the t slider from 0 to 1.
The muted blue body is the start orientation q0. The muted orange body is the
end orientation q1. The bright green body is the interpolated orientation
q(t).
Formula
SLERP interpolates between two unit quaternions:
where:
q0is the start orientationq1is the end orientationtis the interpolation amount from0to1
The full equation is:
theta is the angle between q0 and q1.
Unit quaternions
SLERP expects unit quaternions. If a quaternion is not unit length, normalize it before interpolation.
Why not lerp?
Linear interpolation can cut through quaternion space and may change angular speed. SLERP follows the spherical path between orientations, so the rotation looks smooth and natural.