Skip to content

interpolation


nearest function (generic::nearest)

template <typename T, typename M>
T nearest(M mu, T x1, T x2)

Nearest-neighbor interpolation.

Returns x1 if mu < 0.5, else x2.


linear function (generic::linear)

template <typename T, typename M> T linear(M mu, T x1, T x2)

Linear interpolation.

Linearly blends between x1 and x2 by mu.


cosine function (generic::cosine)

template <typename T, typename M> T cosine(M mu, T x1, T x2)

Cosine interpolation.

Smooth interpolation between x1 and x2 using a cosine curve.


cubic function (generic::cubic)

template <typename T, typename M>
T cubic(M mu, T x0, T x1, T x2, T x3)

Cubic interpolation.

Uses four points for smooth curve fitting.


catmullrom function (generic::catmullrom)

template <typename T, typename M>
T catmullrom(M mu, T x0, T x1, T x2, T x3)

Catmull-Rom spline interpolation.

Smooth curve that passes through x1 and x2.


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/