Cubic/Curve Smooth Interpolation in C#

What you want is a Cubic Hermite Spline:

alt text

where p0 is the start point, p1 is the end point, m0 is the start tangent, and m1 is the end tangent


you could have a linear interpolation and a cubic interpolation and interpolate between the two interpolation functions.

ie.

cubic(t) = cubic interpolation
linear(t) = linear interpolation
cubic_to_linear(t) = linear(t)*t + cubic(t)*(1-t)
linear_to_cubic(t) = cubic(t)*t + linear(t)*(1-t)

where t ranges from 0...1