First of all, this is for image processing. The small circles above is on an image and are my list of points. The points are always in order from p1, p2, p3 to pn. And I am to create a curve that must pass through all the points and the curve must close itself just like in the figure above. Each point has a coordinate of x and y (and I got the list of these coordinates) and the curve will be drawn on the image.
I have been suggested to use Lagrange polynomial, Cubic Hermite spline and splines, but from what I understand, in mathematics, a function f(x) can only output one result. In this case, the points are on a 2D image and the curve will end up closing itself, which cannot be true for a function.
So I come up with a few ideas for this:
Use polar coordinates. This may work valid if we have a list of points that will form a curve that will not "bend back" on itself.
Apply the function f(x) n times, using a few points at a time.
So I want to ask mathematicians here. Normally, in the case like this, what do you do?