Hi all,
I am drawing a best-fit curve that passes through a number of points and then try to calculate the first derivate and so obtain the tangent line of any point along the curve.
There's lots of public domain code that will calculate a Natural Cubic Spline curve given a set of points. However, given any point on the curve i need to be able to calculate the tangent.
I'm not mathematically inclined and so don't understand the formulas as the heart of the Natural Cubic Spline curve and so could not program in java on my own the code needed to get the derivative of the formula to get the tangent at any point. Is there any public domain code out there that will do this?
I've found one that will do it, but it comes with the limitation that "x" must always be increasing which means the curve can't curve back onto itself. Limiting what i could do with it:

http://www.joma.org/mathDL/4/?pa=con...401&bodyId=378


Any help or redirection would be appreciated
k