• Advertisement
Sign in to follow this  

How to smoothly connect a number of points

This topic is 1432 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello every body,

I have attached a picture of a number of points. I need to connect the points smoothly, there should not be any sharp corners. Could any one tell me how that can be done?

Thanks in advance.     

Share this post


Link to post
Share on other sites
Advertisement

Cubic spline interpolation.   You'll probably want a "clamped" version over the "natural" spline

 

What language are you using ?

Share this post


Link to post
Share on other sites

Catmull-Rom is my go to spline.  It goes through all the points, and it won't have any sharp corners.

 

http://www.mvps.org/directx/articles/catmull/

 

 

Basically, each position is determined by the four nearest control points.  (Control points, in this case being your points you've specified.)

 

This has an applet which I think will let you move/add points, to see if its the kind of curve you want.

http://www.cse.unsw.edu.au/~lambert/splines/CatmullRom.html

Edited by ferrous

Share this post


Link to post
Share on other sites

I would like to program in C++. Could you explain a bit "clamped version"?

 

A "clamped" spline is where the value of the first deriviative of the first spline is known in your case, you might want to set it to be the the rate of change between the first two points (y2-y1)/(x2-x1).   In a "natural" spline, you set it to zero.

 

I think this might be what you need:

 

http://www.alglib.net/interpolation/spline3.php#header4

 

It has several different algorithms including Cubic spline, Hermite, Catmull-Rrom, etc.

Share this post


Link to post
Share on other sites

I would like to program in C++. Could you explain a bit "clamped version"?

 
A "clamped" spline is where the value of the first deriviative of the first spline is known in your case, you might want to set it to be the the rate of change between the first two points (y2-y1)/(x2-x1).   In a "natural" spline, you set it to zero.


Not exactly. In a natural spline you generally make the second derivative be zero at the extremes. I would try natural cubic splines first.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement