Graphics Reference
In-Depth Information
Each row in the array is generated from the row above it. Each element in a row is
defined from the two elements in the row above it, which are immediately above and
to the left of it. One does not need a two-dimensional array to implement the algo-
rithm however. One needs only one array of length n + 1. As each new row is gener-
ated it is written on top of the previous row. Computing Bézier curves with the de
Casteljau algorithm is much faster than straightforward evaluation of the polynomial
formula.
To compute the derivative of the Bézier curve, note that
du Bu d
d
n
k
Ê
Ë
ˆ
¯
nk
-
() =
k
(
)
uu
1
-
kn
,
du
(
)
kn
kn k u
!
nkn
kn k uu
-
!
nk
-
nk
-
-
1
k
-
1
(
)
k
(
)
=
1
-
u
-
1
-
(
)
(
)
!
-
!
!
-
!
(
() -
()
)
=
nB
u
B
u
.
(11.56)
kn
--
11
,
kn
,
-
1
It follows that
n
d
du pu
Â
() =
(
() -
()
)
nB
u
B
u
p
i
--
11
,
n
i n
,
-
1
i
i
=
0
n
n
-
1
Â
Â
() -
()
=
nB
u
p
nB u
p
i
--
11
,
n
i
in
,
-
1
i
i
=
1
i
=
0
n-
Â
1
n
-
1
Â
()
()
=
nB u
p
-
nB u
p
.
in
,
-
1
i
+
1
in
,
-
1
i
i
=
0
i
=
0
(B -1,n-1 (n) = B n,n-1 (n) = 0.) Collecting terms gives us the formula we want
n
-
Â
1
d
du pu
() =
(
)
( )
n
pp
-
B
u
.
(11.57)
i
+
1
i
i n
,
-
1
i
=
0
Among other things, this shows that the derivative of a Bézier curve is another Bézier
curve. In particular, one can compute the derivative efficiently with a de Casteljau type
algorithm. Since higher derivatives are themselves just derivatives of functions, it
should not be surprising that there is a recursive formula for the derivative of any
order. See Theorem 11.5.2.6. Right now we simply note the following special cases,
which follow from equation (11.57) applied to p(u) and p¢(u):
¢ () =
(
)
¢ () =
(
)
p
0
n
pp
-
,
p
1
n
p p
-
(11.58)
1
0
n
n
-
1
and
¢¢ () =-
(
)
(
)
¢¢ () =-
(
)
(
)
p
0
n n
1
ppp
-+
2
,
p
1
n n
1
pp p
-
2
+
.
(11.59)
2
1
0
n
n
-
1
n
-
2
Equation (11.58) explains another important property of Bézier curves: the vector
p 0 p 1 is tangent to the curve at the beginning and the vector p n-1 p n is tangent to the
Search WWH ::




Custom Search