Package Exports
- spline-interpolator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (spline-interpolator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
spline-interpolator
Library for smoothing spline interpolation.
Usage
// initialization
const SplineInterpolator = require('spline-interpolator')
const x = [1, 2, 3, 4, 5]
const y = [9, 3, 6, 2, 4]
const interpolator = new SplineInterpolator(x, y)
// interpolate single point
console.log(interpolator.interpolate(4.2))
// >> 1.7468571428571422
// print curve in the range [0.0, 6.0]
for (const [xi, yi] of interpolator.curve(100, [0.0, 6.0])) {
console.log(xi, yi)
}