Search code examples
algorithmmathinterpolationuibezierpathbezier

How to interpolate N points that do not describe a function


Suppose i have n points, also suppose that this points have an order, and not necessary this points make a function. I'm wondering how to interpolate them if the points do not describe a function? For example this will be the original points: Points to Interpolate

And i hope this result:

Interpolated Points

Note that only using splines do not works because the points do not make a function, and also using Bezier curves do not works because them do not interpolate the points (only pass near of them). How can i do for get this? Is there an algorithm for that?


Just an update. Since the accepted answer’s link that I took as a reference is down, I’m going to share an article I wrote based on that for helping others with this issue.

Interpolate 2D points, usign Bezier curves in WPF

Live implementation of the final algorithm. Javascript


Solution

    1. There are a lot of kinds of splines, and, for example, Catmull-Rom splines are applicable here.

    2. Simple and interesting method for interpolation by Bezier curves has been proposed by Maxim Shemanarev