Splines: D.A. Forsyth, With Slides From John Hart
Splines: D.A. Forsyth, With Slides From John Hart
dXi 1
(0) = (1 − t)(Pi+1 − Pi−1 )
• Cardinal splines dt 2
• average points
• t is “tension”
• specify endpoint tangents
• or use difference between first two, last two points
Tension
Interpolating Cubic splines: C^2
Ai (t − ti )3 + Bi (t − ti )2 + Ci (t − ti ) + Di
d2 Xi d2 Xi−1
2
(ti ) = 2
(ti )
dt dt
Curves
Xi (ti ) = Pi = Di
dXi
(ti ) = X�i (ti ) = P�i = Ci
dt
� �
(t − ti ) 3
(t − ti )
2
Xi (t) = Pi 2 −3 +1 +
(∆ti ) 3 (∆ti ) 2
� �
(t − ti )3
(t − ti )2
Pi+1 −2 +3 +
(∆ti ) 3 (∆ti ) 2
� �
(t − ti )3
(t − ti )2
�
Pi −2 + (t − ti ) +
(∆ti ) 2 (∆ti )
� �
� (t − ti )3
(t − ti )2
P i+1 −
(∆ti ) 2 (∆ti )
C^2 Continuity supplies derivatives
• Recurrence relations
• d(n-1) equations in d(n+1) unknowns (d is dimension)
• Options:
• give P’_0, P’_1 (easiest, unnatural)
• second derivatives vanish at each end (natural spline)
• give slopes at the boundary
• vector from first to second, second last to last
• parabola through first three, last three points
• third derivative is the same at first, last knot
More general splines
• Knot vector
t0 < t1 < . . . < tn+k
• Curve n
�
X(t) = Pi Ni,d (t)
k=0
• d is order
2≤d≤n+1
Recursive definition
• Switches=base case
�
1 ti ≤ t ≤ ti+1
Ni,1 =
0 otherwise
• Spline
� �
t − ti
Ni,d = Ni,d−1 (t) +
ti+d−1 − ti
� �
ti+d − t
Ni+1,d−1 (t)
ti+d − ti+1
These figures show
blending functions with
a uniform knot vector,
knots at 0, 1, 2, etc.
The B
Closed B-Splines
Pn+1 = P0
tn+1 = t0
• etc
A B-spline curve, with knots at 0,1,... and order 5
Repeated knots
• Switches=base case
�
1 ti ≤ t ≤ ti+1
Ni,1 =
0 otherwise
• Spline
� �
t − ti
Ni,d = Ni,d−1 (t) +
ti+d−1 − ti
� �
ti+d − t
Ni+1,d−1 (t)
ti+d − ti+1