Example
Interpolate Along a Line
geometric.lineInterpolate(line[, clamp]) returns an interpolator function given a line [a, b]. The returned interpolator function takes a single argument t, where t is a number in [0, 1]; a value of 0 returns a, while a value of 1 returns b. Intermediate values interpolate from a to b along the line segment.
By default, the returned interpolator will clamp the output to the ends of the line segment. You can pass an optional boolean indicating whether to return points outside the line segment if t is greater than 1 or less than 0.
Adjust t to move the interpolated point along the line, and toggle clamping to keep it inside the segment.
Code