Skip to content
Oakfield Operator Calculus Function Reference Site

Linear Interpolation

For a,bRa,b \in \mathbb{R} (or vectors) and αR\alpha \in \mathbb{R},

lerp(a,b;α)=(1α)a+αb\operatorname{lerp}(a,b;\alpha) = (1-\alpha)a + \alpha b

Applies to scalars or vectors in a common linear space. Output lies on the affine segment between aa and bb for α[0,1]\alpha \in [0,1].


Linear in each argument; satisfies lerp(a,b;0)=a\operatorname{lerp}(a,b;0)=a, lerp(a,b;1)=b\operatorname{lerp}(a,b;1)=b. For uniform grids, piecewise lerp yields first-order accurate interpolation.


Extrapolation occurs for α[0,1]\alpha \notin [0,1]. Symmetry: lerp(a,b;α)=lerp(b,a;1α)\operatorname{lerp}(a,b;\alpha) = \operatorname{lerp}(b,a;1-\alpha).


  • α[0,1]\alpha\in[0,1] yields convex combinations; outside this range extrapolates.
  • Symmetry: swapping endpoints corresponds to α1α\alpha\mapsto 1-\alpha.

Clamping bounds α\alpha; normalization can be applied before or after blending.


Oakfield uses linear blending in a few internal “glue” paths:

  • Warp limited continuity blends nearby valid samples (effectively a simple linear average) when a warp gradient is undefined at the probe point.
  • UI/runtime parameter flows often apply explicit a + t(b-a) style blending when smoothing or staging parameter updates (even when not calling a dedicated lerp helper).
  • Math helpers in core/math_utils.h provide sim_lerp_double / sim_lerp_complex for kernels that want a standard lerp.

Linear interpolation is the simplest affine blending operation and a building block for piecewise-linear approximation on grids.

It is a ubiquitous primitive in numerical methods, geometry, and graphics for blending and sampling.


  • Quarteroni, Sacco, Saleri, Numerical Mathematics