Skip to content

BasicInterpolators.Function.createBasicInterpolator

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

commons-math-interpolation / BasicInterpolators / createBasicInterpolator

Function: createBasicInterpolator()

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

Defined in: BasicInterpolators.ts:41

Returns an interpolating function for a dataset, using the specified basic interpolation method.

Parameters

interpolationMethod

BasicInterpolationMethod

The 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 the interpolation method is unknown, or for the invalid input conditions of the create*Interpolator() function of the method (e.g. too few points for the method).

Clone this wiki locally