Re-fetch points

i has an array of points in 3d (imagine the trajectory of a ball) with samples of X.

Now, I want to redo these points so that I have a new array with positions with y patterns.

y can be greater or less than x, but not less than 1. there will always be at least 1 pattern.

What would the algorithm look like to reprogram the original array into a new one? thanks!

+4
source share
2 answers

The main idea is to take your X-points and draw them on the chart. Then interpolate between them using some reasonable interpolation function. You can use linear interpolation, quadric B-splines, etc. Usually, if you have no specific reason to believe that the points are a higher-order function (e.g., N 4 ), you want to stick to a relatively low-level interpolation function.

Once you have done this, you have a (essentially) continuous line on your chart. To get your Y points, you simply select Y points evenly spaced along the X axis.

+4
source

You need to select some kind of interpolation / approximation function based on the original x-patterns (for example, some kind of spline). You can then evaluate this function at y (evenly if you want) to get new patterns.

For math, you can use the Wikipedia article on spline interpolation as a starting point.

+3
source

Source: https://habr.com/ru/post/1308774/


All Articles