Graphics Reference
In-Depth Information
n
Â
()
=
()
pu
B
u
p
in
,
i
i
=
0
n
-
1
n
i
Ê
Ë
ˆ
¯
n
Â
ni
-
(
)
i
(
)
n
=-
1
u
p
+
uu
1
-
p
+
u
p
0
i
n
i
=
1
n
-
1
n
-
1
n
-
1
n
i
-
-
1
1
Ê
Ë
ˆ
¯
Ê
Ë
ˆ
¯
n
Â
ni
-
Â
ni
-
(
)
i
(
)
i
(
)
n
=-
1
u
p
+
uu
1
-
p
+
uu
1
-
p
+
u
p
0
i
i
n
i
i
=
1
i
=
1
n
-
1
È
Í
n
-
1
˘
˙
Ê
Ë
ˆ
¯
n
-
1
Â
ni
- -
1
(
)
(
)
i
(
)
=-
1
uu
1
-
p
+
uu
1
-
p
0
i
i
i
=
1
n
-
1
È
Í
n
i
-
-
1
1
˘
˙
Ê
Ë
ˆ
¯
Â
ni
-
i
-
1
(
)
n
-
1
+
u
u
1
-
u
p
+
u
p
i
n
i
=
1
The terms in square brackets are actually just Bézier curves on n points. Let p
i,j
(u)
denote the Bézier curve defined by the points
p
i
,
p
i+1
,...,
p
j
. Clearly, p
0,n
(u) is just p(u).
Furthermore, by changing variables in the summations above it is easy to see that
()
=-
(
)
( )
+
()
pu
1
up
u
up u
01
,
n
-
1
,
n
()
+
[
()
-
()
]
=
pu
pupu
(11.54)
01
,
n
-
1
,
n
01
,
n
-
It follows that the Bézier curve for n + 1 points is a simple convex linear combination
of two Bézier curves on n points. This leads not only to an efficient way to evaluate
Bézier curves but to a nice geometric construction for sketching such a curve that we
shall indicate by looking at a few examples. First, note that the Bézier curve for one
point
p
0
is just the constant function p(u) =
p
0
. Using this fact and the recursive
formula above gives that the Bézier curve for two points
p
0
and
p
1
is given by
()
=-
(
)
( )
+
()
pu
1
1
up
u
up
u
00
11
(
)
=-
uu
pp
.
+
0
1
In other words, the Bézier curve is just the standard linear parameterization of the
segment [
p
0
,
p
1
]. Next, to compute p(u) in the case of three points
p
0
,
p
1
, and
p
2
, let
(
)
uu
q
=-
p
p
1
0
1
and
(
)
uu.
q
=-
p
p
2
1
2
Then p(u) = (1 - u)
q
1
+ u
q
2
. Figure 11.9(a) shows how this works to find p(1/3). First,
we find the point
A
that is one third of the way on the segment from
p
0
to
p
1
, then
B
, which is one third of the way from
p
1
to
p
2
. Finally, p(1/3) is the point one third
of the way from
A
to
B
. Figure 11.9(b) shows an analogous construction for com-
puting p(1/3) in the case of four points. The points
A
,
B
, and
C
are one third of the
way on the segment from
p
0
to
p
1
, from
p
1
to
p
2
, and from
p
2
to
p
3
, respectively. The