Linearly interpolate a value from an array at the given position. The array is treated as evenly spaced samples along the 0–1 range.
array of values to interpolate between
position along the array (0.0–1.0). Values above 1.0 clamp to the last element. Values below 0.0 extrapolate before the first element.
interpolated value
// interpolate halfway through a curvemath.lerpArray([0, 10, 20], 0.5); // returns 10math.lerpArray([1, 0], 0.75); // returns 0.25 Copy
// interpolate halfway through a curvemath.lerpArray([0, 10, 20], 0.5); // returns 10math.lerpArray([1, 0], 0.75); // returns 0.25
Linearly interpolate a value from an array at the given position. The array is treated as evenly spaced samples along the 0–1 range.