开发者

Cubic Spline class for Obj C or C?

I need to use natural cubic spline interpolation in an iPhone app. Does anyone know of a class for Obj C or C that resembles this: http://www.ee.ucl.ac.uk/~mflanaga/java/CubicSpline.html

"performing 开发者_如何转开发an interpolation within a one dimensional array of data points, y = f(x), using a cubic spline."


Look at this article
This is a sample for Curve Fitting. It uses Cubic Spline Interpolation, and Bezier Spline Curve.


I have implemented it in Javascript. Since there are only several functions (2 "public" functions + internal Gauss-Jordano elimination), conversion to C is pretty straightforward (replace "var" with "int"/"float" etc.).

Article: http://blog.ivank.net/interpolation-with-cubic-splines.html

Code: http://www.ivank.net/blogspot/cspline/CSPL.js

Hope it helps :)


Check out the Docs for UIBezierPath

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜