From Wikipedia, the free encyclopedia
Goal of the algorithm
Suppose we want to evaluate the spline curve
s
→
(
u
)
=
∑
i
=
−
n
p
−
1
d
→
i
N
i
n
(
u
)
,
{\displaystyle {\vec {s}}(u)=\sum _{i=-n}^{p-1}{\vec {d}}_{i}N_{i}^{n}(u),}
defined on the interval
[
u
0
,
u
p
)
{\displaystyle [u_{0},u_{p})}
for a parameter value
x
∈
[
u
ℓ
,
u
ℓ
+
1
)
{\displaystyle x\in [u_{\ell },u_{\ell +1})}
.
Due to the spline locality property, we can write
s
→
(
x
)
=
∑
i
=
ℓ
−
n
ℓ
d
→
i
N
i
n
(
x
)
{\displaystyle {\vec {s}}(x)=\sum _{i=\ell -n}^{\ell }{\vec {d}}_{i}N_{i}^{n}(x)}
So the value
s
→
(
x
)
{\displaystyle {\vec {s}}(x)}
is determined by the controlpoints
d
→
ℓ
−
n
,
d
→
ℓ
−
n
+
1
,
d
→
ℓ
{\displaystyle {\vec {d}}_{\ell -n},{\vec {d}}_{\ell -n+1},{\vec {d}}_{\ell }}
; the other control points have no influence. The goal of de Boor's algorithm is to evaluate
s
→
(
x
)
{\displaystyle {\vec {s}}(x)}
efficiently.
The algorithm
Suppose
x
∈
[
u
ℓ
,
u
ℓ
+
1
)
{\displaystyle x\in [u_{\ell },u_{\ell +1})}
and
d
→
i
[
0
]
=
d
→
i
{\displaystyle {\vec {d}}_{i}^{[0]}={\vec {d}}_{i}}
for
i
=
ℓ
−
n
+
k
,
…
,
ℓ
{\displaystyle i=\ell -n+k,\dots ,\ell }
.
Now calculate
d
→
i
[
k
]
=
(
1
−
α
k
,
i
)
d
→
i
−
1
[
k
−
1
]
+
α
k
,
i
d
→
i
[
k
−
1
]
;
k
=
1
,
…
,
n
;
i
=
ℓ
−
n
+
k
,
…
,
ℓ
{\displaystyle {\vec {d}}_{i}^{[k]}=(1-\alpha _{k,i}){\vec {d}}_{i-1}^{[k-1]}+\alpha _{k,i}{\vec {d}}_{i}^{[k-1]};\qquad k=1,\dots ,n;\quad i=\ell -n+k,\dots ,\ell }
with
α
k
,
i
=
x
−
u
i
u
i
+
n
+
1
−
k
−
u
i
.
{\displaystyle \alpha _{k,i}={\frac {x-u_{i}}{u_{i+n+1-k}-u_{i}}}.}
Then
s
→
(
x
)
=
d
→
ℓ
[
n
]
{\displaystyle {\vec {s}}(x)={\vec {d}}_{\ell }^{[n]}}
.