   Natural cubic splines
  Hi am implementing natural cubic splines right now.Right now I use regular points (x,y), however I have read about equally spaced knots, that simplify the whole math part a lot, though I am a bit worried about the results.equally space knots mean that all points' x value differs only by 1.0e.g.:(0,0)(1,12),(2,14),(3,12) ......All I want to do with the splines is to implement patched surfaces. I only have to interpolate the x y and z values seperately, however the standard representation of cubic splines requires me to feed the x coordinates to each y value which adds a whole lot of code to handle the case when the patches are rotated by 90 ° and to take care of divisions by zero.Any suggestions?   
  Are you implementing this yourself? (And I take "knots" to be synonymous with "control points")I used the glMap2d(GL_MAP2_VERTEX_3, ...) a while ago. The way that is set up, one does not iterate on x. With that you use independent variables, (here: s,t with 0,0 being one corner of the patch and 1,1 being the opposite corner). Maybe a snippet of code would clarify:    // draw the patch    for( s = 0.f; s < 1.f - PARAM_STEP / 2.f; s += PARAM_STEP) { glBegin(GL_QUAD_STRIP); for( t = 0.f; t < 1.f + PARAM_STEP / 2.f; t += PARAM_STEP) {   glEvalCoord2f(s, t);   glEvalCoord2f(s+PARAM_STEP, t); } glEnd();    }  } // for all patchesThe steps are equally sized, but the control points can be wherever. So, keyword: parameterization. Although I have no maths of such to provide to you at the moment.[edit]I think what I'm talking about is a Berstein Expansion of degree (order?) 3. Bezier curves - whereas you want a cubic spline that actually passes through the points?[/edit][Edited by - Bob III on June 3, 2006 6:10:09 PM];  natual cubic splines are a little bit different to bezier curvesthe control points of a bezier curve span up a convex volume the the curve lies ine.g.:p0,p1,p2,3the curve goes through p0 & p3 the endpoints and p1 and p2 give the curve a touch towards their position (towards p1 / p2)natural cubic splines are quite different.Here the resulting curve goes through each controlpoint, however the line between is interpolated. thats why people use cubic splines for interpolation of network packets .I have tested my implementation now.I have got values y0,....,yn to interpolateI can simple pass x values from 0,....,n. for each y0 and the results are pretty good without errors > 0.01%   