Loading...
Logo
Processing Forum

Interpolation between two points

in General Discussion  •  Other  •  1 year ago  
I need to interpolate between two points. Now I know that processing does it for you with the curve command. Can anyone please tell me what kind of interpolation is it.Also, is it possible to follow the curve numerically. What I mean is, if I have two points x,y and I give the command curve(x,y) processing will draw a curve for me. Now is there any way to get the points (x1,y1), (x2,y2),(x3,y3)....that lie between the two points so that I can follow the curve. If not, can anybody tell me a good interpolation function that can be used for this. Any help in this regard will be greatly appreciated

Replies(2)



From the processing reference: " The  curve()  function is an implementation of Catmull-Rom splines. "

To get the points along the curve, take a look at curvePoint().
May I recomend using toxiclibs, check out the Interpolation examples bundled in the library



You can download it here http://toxiclibs.org/downloads/