Linear Interpolation Along a Trajectory

Compute the position of an aircraft at a given distance along a polyline trajectory by locating the active segment, computing the local fraction from cumulative arc lengths, and applying linear interpolation between consecutive waypoints.

Step 1 of 157%

Tutorial

Linear Interpolation Between Two Waypoints

A trajectory is a piecewise-linear path through a sequence of waypoints. To track an aircraft's continuous position along this path, we need to interpolate between consecutive waypoints.

Linear interpolation between two waypoints A\mathbf{A} and B\mathbf{B} at parameter t[0,1]t \in [0,1] is defined as

P(t)=(1t)A+tB.\mathbf{P}(t) = (1-t)\,\mathbf{A} + t\,\mathbf{B}.

The endpoints correspond to t=0t=0 (giving A\mathbf{A}) and t=1t=1 (giving B\mathbf{B}). The midpoint is at t=12t = \tfrac{1}{2}. Each coordinate is interpolated independently.

For example, with A=(4,10)\mathbf{A} = (4, 10), B=(12,30)\mathbf{B} = (12, 30), and t=0.25:t = 0.25{:}

P(0.25)=0.75(4,10)+0.25(12,30)=(3,7.5)+(3,7.5)=(6,15).\begin{align*} \mathbf{P}(0.25) &= 0.75 \cdot (4, 10) + 0.25 \cdot (12, 30) \\[3pt] &= (3, 7.5) + (3, 7.5) \\[3pt] &= (6, 15). \end{align*}
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle