160 COMPUTER AIDED ENGINEERING DESIGN
tn+1 = tn+2 =... = tn+p=b (5.42)
Thus, the first internal knot tpis the average of p–1 parameters u 1 ,u 2 ,... , up–1; the second internal
knottp+1is the average of the next p–1parameters, u 2 , u 3 ,... , up, and so on, with u’s given by
Eq. (5.40).
5.11 Interpolation with B-Splines
Givenn+1 data points p 0 ,p 1 ,... , pn it is desired to fit them with a B-spline curve of given order
p≤n. We can select a set of parameters u 0 ,u 1 ,... , un corresponding to each data point as discussed
in section 5.10. A knot vector [t 0 , t 1 ,... , tm] may then be computed so that m = n + p. Let the set of
unknown control points be b 0 ,b 1 ,... , bn. The B-spline curve may be expressed as
bb() = ()
=0 ,+
tNt
i
n
Σ pp i i (5.43)
Substituting the correspondence of the data points with the parameters, we get
pbkk b
i
n
= (uNuk n) = Σ=0 (^) pp i,+( k) i, = 0,... , (5.44)
or P
p
p
p
p
...
...
=
() () () ()
() () () ()
(
0
1
2
, 0,+10,+20 ,+ 0
, 1,+11,+21 ,+ 1
,
n
pp pp pp pn p
pp pp pp pn p
pp
N u N u N u... N u
N u N u N u... N u
N
⎛
⎝
⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜
⎞
⎠
⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟
uu N u N u... N u
...
N u N u N u... N u
pp pp pn p
pp n pp n pp npnpn
n
2,+12,+22 ,+ 2
, ,+1 , +2 ,+
0
1
)() () ()^2
............
() () () ()
...
...
⎛
⎝
⎜
⎜
⎜
⎜
⎜⎜
⎞
⎠
⎟
⎟
⎟
⎟
⎟⎟
⎛
⎝
⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜
b ⎞
b
b
b ⎠⎠
⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟
= NB (5.45)
Note that for a spatial interpolating B-spline curve, each data point pk would be expressed as a triad
(xk,yk,zk) in Cartesian coordinates implying that both B and P would be (n+1)× 3 in size. Inverting
N and pre-multiplying the result with P would give the triads corresponding to the unknown control
points and hence the interpolating spline. Even though the B-spline basis functions satisfy the local
support property, the shape change of the curve in the interpolation method discussed above is global.
If the position of a single data point is changed, even though the matrix N and its inverse is unchanged,
theP matrix, and therefore the B matrix change, thereby changing the shape of the interpolating curve
overall.
Example 5.9.Interpolate the data points, (0, 0), (0, 1), (2, 3), (2.5, 6), (5, 2), (6, 0) and (7, −3), using
a B-spline curve with piecewise cubic polynomial segments.
The parameters u are first generated for given data points using the chord length method (Eq.
(5.38)). First, the distances between successive data points are computed, that is, d 1 = √(1^2 + 0^2 ) = 1;
d 2 = √(2^2 + 2^2 ) = 2.83; d 3 = √(0.5^2 + 3^2 ) = 3.04; d 4 = √(2.5^2 + 4^2 ) = 4.72; d 5 = √(1^2 + 2^2 ) = 2.24;
d 6 = √(1^2 + 3^2 ) = 3.16. The sum L of these distances is 17. Setting u 0 = 0, we have
u 1 = u 0 + d 1 /L = 0.058 u 4 = u 3 + d 4 /L = 0.682
u 2 = u 1 + d 2 /L = 0.225 u 5 = u 4 + d 5 /L = 0.814
u 3 = u 2 + d 3 /L = 0.404 u 6 = u 5 + d 6 /L = 1.000