Reputation: 231
I am trying to use python to interpolate but I am having some troubles. I have a given set of points in 3D space that form a curve. I do not know the analytic equation of the curve. I need to interpolate some points on that curve that are equally spaced on the curve. Does anyone have any suggestions? Thanks in advance!
Upvotes: 1
Views: 1101
Reputation: 490263
What kind of interpolation best suits?
If linear is all that's required, you can use the formula...
a * (1 - m) + b * m
Where a
is the start, b
is the finish and m
is the magnitude between the points between 0
and 1
.
I wrote a tool where you can visualise different interpolation methods. Choose the one you prefer (note that some interpolate more than 2 points) and check the source code (should be simple enough to translate the JavaScript to Python) to see how it's accomplished.
Upvotes: 3