Returns a linear interpolation function for given pivot points.
Notes: Don't mutate xs and ys arrays after creating this function since data from these arrays is read during interpolation.
The array of X coordinates of pivot points in ascending order.
The array of corresponding Y coordinates of pivot points.
The function that takes X coordinate and returns an interpolated Y coordinate.
const f = lerp(xs, ys);const y = f(x); Copy
const f = lerp(xs, ys);const y = f(x);
Returns a linear interpolation function for given pivot points.
Notes: Don't mutate xs and ys arrays after creating this function since data from these arrays is read during interpolation.