<s>
In	O
the	O
mathematical	O
subfield	O
of	O
numerical	B-General_Concept
analysis	I-General_Concept
de	B-Algorithm
Boor	I-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
a	O
polynomial-time	O
and	O
numerically	B-Algorithm
stable	I-Algorithm
algorithm	O
for	O
evaluating	O
spline	B-Algorithm
curves	I-Algorithm
in	O
B-spline	B-Algorithm
form	O
.	O
</s>
<s>
It	O
is	O
a	O
generalization	O
of	O
de	B-Algorithm
Casteljau	I-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
for	O
Bézier	O
curves	O
.	O
</s>
<s>
Simplified	O
,	O
potentially	O
faster	O
variants	O
of	O
the	O
de	B-Algorithm
Boor	I-Algorithm
algorithm	I-Algorithm
have	O
been	O
created	O
but	O
they	O
suffer	O
from	O
comparatively	O
lower	O
stability	O
.	O
</s>
<s>
A	O
general	O
introduction	O
to	O
B-splines	B-Algorithm
is	O
given	O
in	O
the	O
main	B-Algorithm
article	I-Algorithm
.	O
</s>
<s>
Here	O
we	O
discuss	O
de	B-Algorithm
Boor	I-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
an	O
efficient	O
and	O
numerically	B-Algorithm
stable	I-Algorithm
scheme	O
to	O
evaluate	O
a	O
spline	B-Algorithm
curve	I-Algorithm
at	O
position	O
.	O
</s>
<s>
The	O
curve	O
is	O
built	O
from	O
a	O
sum	O
of	O
B-spline	B-Algorithm
functions	O
multiplied	O
with	O
potentially	O
vector-valued	O
constants	O
,	O
called	O
control	O
points	O
,	O
</s>
<s>
B-splines	B-Algorithm
of	O
order	O
are	O
connected	O
piece-wise	O
polynomial	O
functions	O
of	O
degree	O
defined	O
over	O
a	O
grid	O
of	O
knots	B-Algorithm
(	O
we	O
always	O
use	O
zero-based	O
indices	O
in	O
the	O
following	O
)	O
.	O
</s>
<s>
De	B-Algorithm
Boor	I-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
uses	O
O(p2 )	O
+	O
O(p )	O
operations	O
to	O
evaluate	O
the	O
spline	B-Algorithm
curve	I-Algorithm
.	O
</s>
<s>
Note	O
:	O
the	O
main	B-Algorithm
article	I-Algorithm
about	I-Algorithm
B-splines	I-Algorithm
and	O
the	O
classic	O
publications	O
use	O
a	O
different	O
notation	O
:	O
the	O
B-spline	B-Algorithm
is	O
indexed	O
as	O
with	O
.	O
</s>
<s>
B-splines	B-Algorithm
have	O
local	O
support	O
,	O
meaning	O
that	O
the	O
polynomials	O
are	O
positive	O
only	O
in	O
a	O
finite	O
domain	O
and	O
zero	O
elsewhere	O
.	O
</s>
<s>
Let	O
the	O
index	O
define	O
the	O
knot	B-Algorithm
interval	O
that	O
contains	O
the	O
position	O
,	O
.	O
</s>
<s>
We	O
can	O
see	O
in	O
the	O
recursion	O
formula	O
that	O
only	O
B-splines	B-Algorithm
with	O
are	O
non-zero	O
for	O
this	O
knot	B-Algorithm
interval	O
.	O
</s>
<s>
Similarly	O
,	O
we	O
see	O
in	O
the	O
recursion	O
that	O
the	O
highest	O
queried	O
knot	B-Algorithm
location	O
is	O
at	O
index	O
.	O
</s>
<s>
This	O
means	O
that	O
any	O
knot	B-Algorithm
interval	O
which	O
is	O
actually	O
used	O
must	O
have	O
at	O
least	O
additional	O
knots	B-Algorithm
before	O
and	O
after	O
.	O
</s>
<s>
In	O
a	O
computer	O
program	O
,	O
this	O
is	O
typically	O
achieved	O
by	O
repeating	O
the	O
first	O
and	O
last	O
used	O
knot	B-Algorithm
location	O
times	O
.	O
</s>
<s>
For	O
example	O
,	O
for	O
and	O
real	O
knot	B-Algorithm
locations	O
,	O
one	O
would	O
pad	O
the	O
knot	B-Algorithm
vector	I-Algorithm
to	O
.	O
</s>
<s>
With	O
these	O
definitions	O
,	O
we	O
can	O
now	O
describe	O
de	B-Algorithm
Boor	I-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
algorithm	O
does	O
not	O
compute	O
the	O
B-spline	B-Algorithm
functions	O
directly	O
.	O
</s>
<s>
De	B-Algorithm
Boor	I-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
more	O
efficient	O
than	O
an	O
explicit	O
calculation	O
of	O
B-splines	B-Algorithm
with	O
the	O
Cox-de	O
Boor	O
recursion	O
formula	O
,	O
because	O
it	O
does	O
not	O
compute	O
terms	O
which	O
are	O
guaranteed	O
to	O
be	O
multiplied	O
by	O
zero	O
.	O
</s>
<s>
The	O
following	O
code	O
in	O
the	O
Python	B-Language
programming	I-Language
language	I-Language
is	O
a	O
naive	O
implementation	O
of	O
the	O
optimized	O
algorithm	O
.	O
</s>
