B Splines PDF
B Splines PDF
B Splines PDF
1 Definitions
dφn (t)
1-1 We say a curve φ(t) ∈ C n [a, b] (C-n continuous in the interval [a,b]) if is defined for all values
dtn
of t ∈ [a, b].
1-2 Spline is a composite curve made from joining several pieces together in such a way that the continu-
ity is maintained at all the points in the interval. Splines are useful in interpolation and approximation.
When we refer to φ(t) as a spline we mean the following,
1-3 The partition of interval [a, b] or knot vector is defined as an n-tuple of numbers (t0 , t1 , t2 , ...tm ) such
that a = t0 ≥ t1 ≥ t2 .... ≥ tm = b
1-4 We can construct a spline with several polynomials π j (t) defined in each sub-interval [t j , t j+1 ]
k
1-5 B-Spline is a blending of polynomial splines r(t) = φi (t)Pi , where Pi are control points.
P
i=0
i+m
φi (t) = π j (t) support of φi (t) = [ti , ti+m ]
S
j=i
ψ(t) = Πn t ≥ t0
=0 t < t0
• For continuity at t = t0 , ψ(t0 ) = 0 on both sides resulting in Πn (t0 ) = 0. This polynomial can be
expressed by shifting the parameter by t0 ,
Πn = b1 (t − t0 ) + b2 (t − t0 )n + ... + bn (t − t0 )n
-
ME/MF 342 Computer Aided Design
• If ψ(t) ∈ C p (R),
ψ(t0 ) = ψ0 (t0 ) = ....ψ(p) (t0 ) = 0 =⇒ b1 = b2 = ... = b p = 0
• If p = n =⇒ b1 = b2 = ... = bn = 0 but we require bn , 0.
• This implies pmax = n − 1 and b1 = ... = bn−1 = 0 and bn , 0 and
Πn = bn (t − t0 )n
• A plus sign is used as a suffix to represent this spline,
(t − t0 )n (t − t0 ) ≥ 0
ψ(t) = (t − t0 )n+ =
0
(t − t0 ) < 0
• ψ(t) ∈ C n−1 (R)
The function Ni,m is a basis function for a B-spline curve which is of order m and is computed by a
recursive formula given by deBoor’s algorithm (1972).
1, t ∈ [ti , ti+1 ]
Ni,1 (t) =
and
0, t < ]ti , ti+1 [
(t − ti )Ni,p−1 (t) (ti+p − t)Ni+1,p−1 (t)
Ni,p (t) = + To repeat from p = 2 to m
ti+p−1 − ti ti+p − ti+1
2-6 The above recursion formula roots from the divided difference method and to understand the mathe-
matical properties of Ni,m , we need to put some effort in understanding divided difference method.
Page 2
ME/MF 342 Computer Aided Design
2-7 B-spline basis function φ(t) can be shown to be an mth divided difference of a function defined as
f m−1 (tν , t) := (tν − t)+m−1
where (tν − t)+m−1 = (tν − t)m−1 for (tν − t) > 0
(tν − t)m−1
+ = 0 for (tν − t) ≤ 0
But what is a divided difference?
2-9 Let tν denote the knot vector (ti , ti+1 , ti+2 ,...,ti+k ), and f (tν ) the values of the functions at these knot
values given by ( f (ti ), f (ti+1 ), f (ti+2 ),..., f (ti+k )), the successive divided differences are defined in the
following way,
Zeroth divided difference of f (tν ) := f [ti ] = f (ti )
f [ti+1 ] − f [ti ]
First divided difference of f (tν ) := f [ti , ti+1 ] =
ti+1 − ti
f [ti+1 , ti+2 ] − f [ti , ti+1 ]
Second divided difference of f (tν ) := f [ti , ti+1 , ti+2 ] =
ti+2 − ti
f [ti+1 , ..., ti+p ] − f [ti , ..., ti+p−1 ]
pth divided difference of f (tν ) := f [ti , ..., ti+p ] =
ti+p − ti
2-10 For brevity we will use an alternative notation to represent the divided differences as follows:
∆ip f (tν ) := f [ti , ..., ti+p ]. As per this notation we can express the above recursion relation as
∆i+1
p−1
f (tν ) − ∆ip−1 f (tν )
∆ip f (tν ) :=
ti+p − ti
Let us practice
If tν =[ 0,1,2,3,4,5,6,7,8,9] and f (tν ) = t3 , determine all the possible divided differences.
Answer:
∆0 f = [ 0,1,8,27,64,125,216,343,512,729]
∆1 f = [1,7,19,37,61,91,127,169,217]
∆2 f = [3,6,9,12,15,18,21,24]
∆3 f = [1,1,1,1,1,1,1]
∆4 f = [0,0,0,0,0,0]
Page 3
ME/MF 342 Computer Aided Design
2-12 Divided difference of a function can also be expressed using the following formula,
i+p
P f (tr )
∆ip f (tν ) = 0
r=i w (tr )
i+p
w(t) = (t − ti )(t − ti+1 )(t − ti+2 )...(t − ti+p ) =
Q
(t − tr )
r=i
Example 1
If tν = [t0 , t1 ] is the knot vector and [y0 , y1 ] are values of the function at tν , show the
equivalence of the above two definitions of divided differences
y1 − y0
∆10 y = as per definition [2-10]
t1 − t0
y0 y1
∆10 y = + as per definition [2-12].
t0 − t1 t1 − t0
Example 2
If θν = [θ0 , θ1 , θ2 , θ3 ], find 3rd divided difference of sin θν using above formula.
Answer
sin θ0 sin θ1
∆30 = +
(θ0 − θ1 )(θ0 − θ2 )(θ0 − θ3 ) (θ1 − θ0 )(θ1 − θ2 )(θ1 − θ3 )
sin θ2 sin θ3
+ +
(θ2 − θ1 )(θ2 − θ0 )(θ2 − θ3 ) (θ3 − θ1 )(θ3 − θ2 )(θ3 − θ0 )
Page 4
ME/MF 342 Computer Aided Design
φ(t) = ∆m m−1
i (tν − t)+ is a B-spline.
2-13 To see that φ(t) is a B-spline, we need to demonstrate that φ(t) has the three important properties
mentioned in 1-2.
From the expanded form of divided difference we have:
(ti − t)+m−1 (ti+1 − t)m−1
+ (ti+2 − t)m−1
+ (ti+m − t)m−1
+
φ(t) = ∆mi (tν − t)+m−1 = + + + .... +
w0 (ti ) w0 (ti+1 ) w0 (ti+2 ) w0 (ti+m )
§1 : φ(t) ∈ C m−2
All the terms are of the form shown in 1-6 and are C m−2 continuous .
Since each term is a C m−2 continuous function of t, the sum of all the terms must me C m−2 continuous.
t ≥ ti+m =⇒ t ≥ ti+m ≥ ti+m−1 ≥ ti+m−2 ... ≥ ti . Hence all terms of φ are zero
§3 : φ(t) = 0, for t ≤ ti .
tRi+m
1
§4 : φ(t) dt =
ti m
This statement can be shown by using the remainder term of a Taylor series of a power function.
Consider the Taylor series expansion of a general function f (t),
Page 5
ME/MF 342 Computer Aided Design
1 00 1
f (t) = f (ti ) + f 0 (ti )(t − ti ) + f (ti )(t − ti )2 + ... + f (m−1) (ti )(t − ti )m−1
2! (m − 1)!
Zt
1
+ f (m) (s)(t − s)(m−1) ds
(m − 1)!
ti
Zti+m
1
= Πm−1 (t − ti ) + f (m) (s)(t − s)(m−1)
+ ds
(m − 1)!
ti
Substituting f (t) = tm and taking mth divided difference on both sides gives,
tRi+m
1
1=0+ m!∆mi (tν − s)m−1
+ ds
(m − 1)! ti
Let f (tν , t) := (tν − t)+m−2 and g(tν , t) := (tν − t)+ such that
(tν − t)m−1
+ = f (tν , t)g(tν , t)
Leibnitz rule for divided differences of a product of two functions:
∆mi (tν − t)m−1
+ = ∆0i f (tν , t)∆mi g(tν , t) + ∆1i f (tν , t)∆m−1
i+1 g(tν , t) + ∆i f (tν , t)∆i+2 g(tν , t) . . .
2 m−2
m
= ∆ri f (tν , t)∆i+r
m−r
g(tν , t)
P
r=0
Hence in (#1) only the last two terms survive. Let Mm,i := ∆mi (tν − t)m−1
+ . Simplification of (#1) leads
to,
Mm,i = ∆m−1
i (tν − t)+m−2 + (ti+m − t)∆mi (tν − t)m−2
+
Page 6
ME/MF 342 Computer Aided Design
∆i+1
m−1
(tν − t)m−2 − ∆mi (tν − t)m−2
" #
+ +
Mm,i = Mm−1,i + (ti+m − t)
ti+m − ti
" #
ti+m − t
Mm,i = Mm−1,i + (Mm−1,i+1 − Mm−1,i )
ti+m − ti
" # " #
t − ti ti+m − t
Mm,i = Mm−1,i + Mm−1,i+1
ti+m − ti ti+m − ti
Page 7