   Splines
  I'm looking into using splines to create a smooth curve from a series of points. To start with, I'm looking at cardinal and Catmull Rom splines. Q1.If I have a series of points, I can calculate the tangent of a point using the point before and the point after by subtracting the points and normalising the result. How do I calculate the tangent of the start and end vertices?Q2. Is there a way I can specify the tangent of certain points, and have the curve adapt to these? Hopefully this would allow for known and non-known tangents.I'm unsure of the terminology more than anything. If any of these concepts have names, or there are certain subject areas I should be looking into then please let me know what they are!Thanks in advance.   
  The basis of cardinal and Catmull-Rom splines requires a point on either side of the desired point on the curve, so you can't calculate the tangents of the start and end points using those methods.By the way, choosing the tangent for a point as the average of the previous/next points is a special case of the Catmull-Rom spline, not a general case.Yes, you can specify the tangents of the previous/next points to customize the curve. Take a look at the first equation at this site.;  Thanks for that. I've got everything working apart from one thing:I'm using the 'Unit interval' interpolation method for calculating the position between two points. Is there a method by which I can calculate the interpolated tangent at this position as well?Thanks again.   ;Quote:Is there a method by which I can calculate the interpolated tangent at this position as well?That'd be the first derivative. So:p(t) / dt = (6t^2 - 6t)p0 + (3t^2 - 4t + 1)m0 + (-6t^2 + 6t)p1 + (3t^2 - 2t)m1Edit: Sorry it was not quite clear if you are doing a 1D- or a 2D interpolation (or even 3D). Anyway, with multiple dimensions you will need to do the interpolation of the points for every dimension seperately. This applies to the tangent calculation, too.   ;  Thanks for that - works perfectly! FYI, it's a 3D interpolation, but at the moment I'm only using it in 2D (Z is always 0). Do you know of any articles or other links that describe the formula you gave? Or, failing that, is there a name for it? I just don't like to use formula I don't know anything about. :pMany thanks, once again   ;Quote:Do you know of any articles or other links that describe the formula you gave? Or, failing that, is there a name for it?Well, it's actually called (the first) derivative. And sorry, no, I did not take that from an article but calculated it from the wiki formula myself. If you are given a function and are looking for a tangent that's when derivatives come into play.Again wiki can explain what a derivative is exactly.;  Good to know. Thanks again.   