-
Notifications
You must be signed in to change notification settings - Fork 7
BasicInterpolators.Function.getFallbackInterpolationMethod
Christian d'Heureuse edited this page Sep 25, 2026
·
1 revision
commons-math-interpolation / BasicInterpolators / getFallbackInterpolationMethod
function getFallbackInterpolationMethod(interpolationMethod, n): BasicInterpolationMethod;Defined in: BasicInterpolators.ts:68
Degrades an interpolation method when there are too few points for it.
-
"akima"with fewer than 5 points is replaced by"cubic". -
"cubic"with fewer than 3 points is replaced by"linear". - Any method with fewer than 2 points is replaced by
"nearestNeighbor". The resulting function returns the y value of the single point, orNaNif there are no points.
The rules are applied one after the other, so e.g. "akima" with 2 points results in "linear".
The requested interpolation method.
number
The number of points.
The interpolation method that can be used for n points.