Quaternion Interpolation

LERP and SLERP - Linear and spherical interpolation of quaternions

Quaternion Interpolation Calculator

Quaternion Interpolation

Interpolates between two quaternions q₁ and q₂ using linear (LERP) or spherical linear (SLERP) interpolation

Interpolation methods

LERP: Simple linear interpolation - fast but not constant speed
SLERP: Spherical interpolation - constant speed on the unit sphere

Enter two quaternions for interpolation
Start quaternion (q₁)
Target quaternion (q₂)
0.0 = q₁, 1.0 = q₂, 0.5 = midpoint


Quaternion interpolation result
W (scalar):
X (i comp.):
Y (j comp.):
Z (k comp.):
Interpolation: q(t) = (1-t)·q₁ + t·q₂ (LERP) or spherical interpolation (SLERP)

Interpolation Info

Types of interpolation

LERP: Linear interpolation - simple
SLERP: Spherical interpolation - uniform

LERP SLERP Weight t

LERP: Fast, simple to compute
SLERP: Constant speed, smoother

Weight parameter
t = 0.0: Fully q₁ (start)
t = 0.5: Midpoint between q₁ and q₂
t = 1.0: Fully q₂ (target)


Formulas for Quaternion Interpolation

Interpolation parameter
\[t \in [0, 1] \quad \text{with } t = 0 \Rightarrow q_1, \quad t = 1 \Rightarrow q_2\]

Weight parameter between 0 and 1

LERP - Linear interpolation
\[\begin{align} \text{LERP}(q_1, q_2, t) &= (1-t) \cdot q_1 + t \cdot q_2 \\ &= q_1 + t(q_2 - q_1) \end{align}\]

Simple weighted sum

SLERP - Spherical interpolation
\[\begin{align} \text{SLERP}(q_1, q_2, t) &= \frac{\sin((1-t)\theta)}{\sin(\theta)} q_1 \\ &+ \frac{\sin(t\theta)}{\sin(\theta)} q_2 \end{align}\]

Constant speed on the unit sphere

SLERP angle computation
\[\begin{align} \cos(\theta) &= q_1 \cdot q_2 \\ &= w_1 w_2 + x_1 x_2 + y_1 y_2 + z_1 z_2 \end{align}\]

Angle between the quaternions

LERP vs SLERP
\[\begin{align} \text{LERP:} &\quad O(1) \text{ - fast} \\ \text{SLERP:} &\quad O(\log n) \text{ - uniform} \end{align}\]

Speed vs. quality

Examples for Quaternion Interpolation

Example 1: LERP interpolation
q₁ = 3 + 2i + 4j + 1k q₂ = 1 + 3i + 5j + 2k t = 0.5
LERP calculation: \[\begin{align} q(0.5) &= 0.5 \cdot q_1 + 0.5 \cdot q_2 \\ w &= 0.5(3) + 0.5(1) = 2 \\ x &= 0.5(2) + 0.5(3) = 2.5 \\ y &= 0.5(4) + 0.5(5) = 4.5 \\ z &= 0.5(1) + 0.5(2) = 1.5 \end{align}\]

q = 2 + 2.5i + 4.5j + 1.5k

Example 2: SLERP vs LERP
Unit quaternions 90° rotation
Difference: \[\begin{align} \text{LERP} &: \text{Variable speed} \\ \text{SLERP} &: \text{Constant speed} \\ |\text{LERP}(q_1, q_2, t)| &\neq 1 \\ |\text{SLERP}(q_1, q_2, t)| &= 1 \end{align}\]

SLERP preserves unit length

Use cases
Animation
Bone rotation
Camera paths
Smooth transitions
Robotics
Path planning
Physics engine
Time integration

Interpolation enables smooth orientation transitions without jumps

Step-by-step guide
LERP procedure
  1. Enter both quaternions
  2. Choose weight t (0.0 to 1.0)
  3. Formula: (1-t)·q₁ + t·q₂
  4. Compute components individually
SLERP procedure
  1. Compute dot product: q₁·q₂
  2. Angle θ = arccos(q₁·q₂)
  3. Compute sine weights
  4. Form weighted sum

Applications of Quaternion Interpolation

Quaternion interpolation is essential for smooth animations and transitions:

Animation & 3D Graphics
  • Character animation: bone rotation
  • Camera moves: smooth pans
  • Object rotation: uniform turns
  • Morphing: pose transitions
Robotics & Control
  • Path planning: smooth motion profiles
  • Joint control: jerk-free movements
  • Orientation control: smooth transitions
  • Calibration: interpolated corrections
Gaming & VR/AR
  • Character control: realistic motion
  • Camera systems: cinematic shots
  • VR tracking: natural head movement
  • Physics engines: time-integrated rotation
Key properties
  • LERP: Fast, but variable speed
  • SLERP: Constant speed, but more expensive
  • Normalization often required after LERP
  • SLERP may be numerically unstable for small angles

Quaternion Interpolation: the key to natural animations

Quaternion interpolation is fundamental for producing smooth, natural movements in 3D applications. While linear interpolation (LERP) is simple and fast, spherical linear interpolation (SLERP) provides constant rotational speed and avoids unnatural acceleration. SLERP operates on the 4D unit sphere and ensures interpolated quaternions remain normalized. These properties make SLERP the preferred method for high-quality animations, while LERP suits real-time scenarios with performance requirements.

Summary

The choice between LERP and SLERP depends on requirements: LERP for performance, SLERP for quality. In practice hybrid approaches are common—SLERP for visible animations and LERP for internal calculations. Modern game engines and animation tools use optimizations such as NLERP (normalized LERP) as a compromise between speed and quality. Quaternion interpolation enables representing complex 3D rotations in natural motion sequences and is indispensable for modern 3D applications.




More Quaternion Functions

Addition  •  Subtraction  •  Division  •  Multiplication  •  Concatenate  •  Length  •  Interpolation  •  Normalize  •  Scalar Multiplication  •  Dot Product  •  Yaw-Pitch-Roll  •  Conjugates  •  Inverse  •  Negation  •