Skip to content

BasicInterpolators.Function.createBasicInterpolatorWithFallback

Christian d'Heureuse edited this page Sep 25, 2026 · 1 revision

commons-math-interpolation / BasicInterpolators / createBasicInterpolatorWithFallback

Function: createBasicInterpolatorWithFallback()

function createBasicInterpolatorWithFallback(
   interpolationMethod, 
   xVals, 
   yVals
): UniFunction;

Defined in: BasicInterpolators.ts:99

Returns an interpolating function for a dataset, using the specified basic interpolation method or a simpler method if there are too few points (see getFallbackInterpolationMethod).

Parameters

interpolationMethod

BasicInterpolationMethod

The requested interpolation method.

xVals

ArrayLike<number>

The arguments of the interpolation points, in strictly increasing order. The values must be finite.

yVals

ArrayLike<number>

The values of the interpolation points.

Returns

UniFunction

A function which interpolates the dataset.

Throws

Error If xVals and yVals have different lengths, if the interpolation method is unknown, or if xVals contains non-finite values or is not strictly increasing.

Clone this wiki locally