CompuServe Thread

#C – MATH – CURVE FIT

6 messages in this thread
#23667From: – VisitorJan 18, 1990 1:58 PM
I am trying to find a C routine or the math formula to draw a smooth curve through a given set of points. For example I would like to draw a smooth curve between points like these ( a foil shape ) . . . . . Carol Barron informed me there might be a C routine in this forum which will do this. Any help in this direction would be appreciated.
#23669From: John M. DlugoszJan 18, 1990 4:03 PM
I remmeber seeing cubic splines and stuff _somewhere_, but I have no idea where. COuld it have been a Borland toolbox?
#23670From: Mike Floyd/DDJJan 18, 1990 5:37 PM
Have you looked at Bezier curves? Bezier curves allow you to draw smoothed curves for any number of points. The curve is connected by the end points and the inner points act as "control" points where each control point influences the shape of the curve. Kent Porter covers them in detail in "Stretching Turbo C" (Brady Books, NY) complete with source. Another good book is "Graphics Programming in C" (M&T Books, CA) by Roger T. Stevens. — MF
#23673From: Jack CrenshawJan 18, 1990 7:56 PM
Mike, Bezier won't do what Aaron wants, since he wants a curve passing through specific intermediate points. Splines are the right answer. Jack
#23681From: Mike Floyd/DDJJan 19, 1990 10:28 AM
I see! (I should have read his question more carefully.) Roger Stevens covers B-splines in the same book. — MF
#23677From: Tom Genereaux/DDJJan 18, 1990 10:38 PM
You want a B-Spline algorithm. There were a couple of curve fitting routines here on the forum, I don't remember the names. I'll check my archives and see what I can come up with. B-Splines are discussed in depth in Newman and Sproull and in Van Dam, and are also to be found in Numerical Recipes in C. Tom G.