Home > Degrafa, Math > Cardinal Splines Part 5

Cardinal Splines Part 5

October 8, 2009

Continuing from part 4 of this series, we are looking at tension values outside the range of zero to one. When T is negative, then s = (1-T)/2 increases from 1/2 and grows without limit as T becomes larger negative. So, what happens for large values of s?

Using the same four knots and the same equation from part 4 of this series, P(0.5) serves as an approximate representation of the midpoint of the curve from P2 to P3. The curve is not naturally arc-length parameterized, so P(0.5) is a convenient point on the curve ‘away’ from both endpoints.

The expectation is that as s increases, the curve tends to follow the tangents more closely. Now,

P(0.5) = s/8[(P3 – P1) + (P2 – P4)] + 0.5(P2 + P3)

The second term is the midpoint between P2 and P3. If Pt(t) denotes the tangent, the above equation becomes

P(0.5) = s/8[Pt(0) – Pt(1)] + 0.5(P2 + P3)

The first term is the difference between the two tangents, multiplied by a constant term that grows without bound. The endpoint of this vector is added to the midpoint between P2 and P3. That means that P(0.5) is pushed arbitrarily far away from the fixed point 0.5(P2 + P3) as s increases without bound.

The following diagram shows what happens when s = 1 (corresponding to T = -1). The red curve is the Degrafa Catmull-Rom spline (s = 1/2) and the blue curve is the Cardinal spline with s = 1. Note the tendency for the curve to stay closer to the tangents at each join. Point reflection is used to compute the auxiliary points at the beginning and end (i.e. before P1 and after P4).

Cardinal Spline s = 1

Cardinal Spline s = 1

A cubic curve only has so much flexibility in terms of inflection. Driving T too far negative (and thus s too far away from 1/2) can cause strange behavior as shown in the case where s = 2, below.

Cardinal Spline s = 2

Cardinal Spline s = 2

Exact behavior varies depending on how the auxiliary points are chosen.

The case where T > 1 drives s negative. This reverses the role of in- and out-tangents. This causes the spline to loop around itself at each join. Look at the comments from part 4 for a link to a good demo of this case.

These extreme cases serve as poor interpolants, but can be used to draw cool-looking curves. So, there is some justification for allowing tension values outside the typical [0,1] range.

Categories: Degrafa, Math
  1. October 8, 2009 at 12:14 pm

    Actually I always thought (or “felt”) that Catmull-Rom is too close to linear interpolation; from now on I think I am going to use this formula with s > 0.5 instead. However, it would be great to have some way to specify curvature radius at joins instead.

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: