I have a line in the form of an array of coordinate points:
[{x1,y1}, [x2,y2], ect...]
The points which make up the line are at varying distances from one another.
My goal is to make a function which takes this line and split it up into evenly separated distances.
All I'm looking for is the terminology for this process... Interpolation? because I want to search for it and not reinvent the wheel.
I would call that segmentation.
First you determine the linear function that defines the line itself; at least two points are required for that.
Afterwards, you need: 1. The above linear function 2. Two values of x that will define the leftmost and rightmost point 3. The segment length, so that the hypothenuse between the endpoints is a multiple of it.
Finally you create a function that takes the above three pieces of data and returns a list of points, evenly separated by given segment length.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With