A lightweight library for the interpolation. It performs the Lagrange interpolation:
To find a function, pass known points to the Math.interpolate()
method:
const points = [
[2,6], [3,12], [4,20], [5,30]
];
const f = Math.interpolate(points);
// x²+x
f(4) // 20
f(1.5) // 3.75