   derivative of cubic spline , nurbs ?
    I have been busy developing graphics relevant routines .  For uniformally sampled data , I can now generate control points that will fit a cubic spline through all of the data points ; without the use of matrix operations .  I'm now wondering about the most appropriate way of obtaining the first and second derivatives of the cubic spline .  Using the derivative of the control points , via a simple difference equation might suffice ; if I use this approach should I then use a quadratic spline as the interpolator  for the first derivative .  Repeat and use linear spline as interpolator  for the second derivative .  Otherwise a difference equation might be applied to the interpolated values from the cubic spline .   Does NURBS provide a convenient way to generate the 1st  & 2nd derivatives of a cubic spline .   
Quote:Original post by Luxan  I have been busy developing graphics relevant routines .  For uniformally sampled data , I can now generate control points that will fit a cubic spline through all of the data points ; without the use of matrix operations .I would be curious as to how you are doing that, because i am researching the same things. If you are breaking your cubic spline into joined cubic bezier curves, it's easy to find the derivitive/slope for that. class Bezier {public:Bezier() {};float x1,x2,x3,x4,y1,y2,y3,y4;void GetPosition( float t, float &x, float &y ) { float f0 = pow( (1.0f-t), 3.0f ); float f1 = 3.0f * t * ( (1.0f-t) * (1.0f-t) ); float f2 = 3.0f * t * t * (1.0f-t); float f3 = t * t * t; x = x1*f0 + x2*f1 + x3*f2 + x4*f3; y = y1*f0 + y2*f1 + y3*f2 + y4*f3; }void GetSlope( float t, float &x, float &y ) { float df0 = (6.0f * t) - (3.0f * t * t) - 3.0f; float df1 = 3.0f - (12.0f * t) + (9.0f * t * t); float df2 = (6.0f * t) - (9.0f * t * t); float df3 = 3.0f * t * t; x = x1*df0 + x2*df1 + x3*df2 + x4*df3; y = y1*df0 + y2*df1 + y3*df2 + y4*df3; }};I found these papers of use on the topic, particularly this one and this one.   ;  Eventually I shall post the relevant code to anotherprogramming group that I belong to , along with an illustrated explanation . I can then provide a link tothe code . You may need to , temporarily , join the groupto be able to download the file . Users of that group might also provide some insight .   Alternately I might attach the code to a post .  Or , perhaps , illustrate via an html page .   I'm using the method mentioned in my previous post ,in particular deconvolution then interpolation , of the complete , uniformally sampled , dataset .  I need to download a free dll and adapt it for use with theprogram I have written, rather than relying solely upon the code module that I wrote for a particular purpose .  This may take awhile .  Finding the derivatives will determine where a curve israpidly changing , these are the locations where more interpolated points , using original control points and spline ,need to be evaluated .  The second derivative , of the control points , appearsto be essential .    Derivatives of the Control Points is desirable , as thisprovides a more rapid way to do interpolation .  As the application of a difference equation to the controlpoints effectively reduces the next number of control points ,I'd say that the derivative of the interpolating splineshould be used . Anyway I , and others , shall have an opportunity to determine this , once the code is distributed .Luxan ,   