CG Qna
CG Qna
CG Qna
1
9.4 2 BEZIER CURVES –– Getting the shape you want
Historically, parametric equations were often used to model the motion of objects, and that is the approach
we have seen so far. But more recently, as computers became more common in design work and
manufacturing, a need arose to efficiently find formulas for shapes such as airplane wings and automobile
bodies and even letters of the alphabet that designers or artists had created.
One simple but inefficient method for describing and storing the shape of a curve is to measure the location
and save the coordinates of hundreds or thousands of points along the curve. This result is called a
"bitmap" of the shape. However, bitmaps typically require a large
amount of computer memory, and when the bitmap is reconverted
from stored coordinates back into a graphic image, originally
smooth curves often appear jagged (Fig. 1). Also, when these
bitmapped shapes are stretched or rotated, the new location of every
one of the points must be calculated, a relatively slow process.
A second method, still simple but more efficient than bitmaps, is to store fewer points along the curve, but to
automatically connect consecutive points with line segments (Fig. 2). Less computer memory is required since
fewer coordinates are stored, and stretches and rotations are calculated more quickly since the new locations of
fewer points are needed. This method is commonly
used in computer graphics to store and redraw surfaces
(Fig. 3). Sometimes instead of saving the coordinates
of each point, a "vector" is used to describe how to get
to the next point from the previous point, and the
result is a "vector map" of the curve. The major
drawback of this method is that the stored and redrawn
curve consists of straight segments and corners even
though the original curve may have been smooth.
9.4.5 Bezier Curves Contemporary Calculus 2
The primary building block for curves and surfaces represented as line segments is the line segment given
by parametric equations.
d y(t) d x(t)
d t = – y0 + y1 and d t = – x0 + x1
dy dy/dt y1 – y0
so d x = dx/dt = x – x , the slope of the line segment from P0 to P1 .
1 0
Practice 1: Use the pattern of Example 1 to write parametric equations for the line segments that
(a) connect (1,2) to (5, 4), (b) connect (5, 4) to (1, 2), and (c) connect (6, –2) to (3, 1).
Bezier Curves
One solution to the problem of efficiently saving and redrawing a smooth curve was independently
developed in the 1960s by two French automobile engineers, Pierre Bezier (pronounced "bez–ee–ay") who
worked for Renault automobile company and P. de Casteljau who worked for Citroen. Originally, the
solutions were considered industrial secrets, but Bezier's work was eventually published first. The curves
that result using Bezier's method are called Bezier curves. The method of Bezier curves allow us to
efficiently store information about smooth (and not–so–smooth) shapes and to quickly stretch, rotate and
distort these shapes. Bezier curves are now commonly used in computer–aided design work and in most
computer drawing programs. They are also used to specify the shapes of letters of the alphabet in different
fonts. By using this method, a computer and a laser printer can have many different fonts in many different
sizes available without using a large amount of memory. (Bezier curves were used to produce most of the
graphs in this book.)
Here we define Bezier curves and examine some of their properties. At the end of this section some
optional material describes the mathematical construction of Bezier curves.
9.4.5 Bezier Curves Contemporary Calculus 3
The Bezier curve B(t) defined for the four points P0, P1, P2 ,
and P3 (Fig. 5) is
for 0 ≤ t ≤ 1:
The four points P0 , P1, P2, and P3 are called control points for the Bezier curve. Fig. 6 shows Bezier
curves for several sets of control points. The dotted lines connecting the control points in Fig. 6 are
shown to help illustrate the relationship between the graph of B(t) and the
control points.
Solution:
x(t) = (1 – t) .0 + 3(1 – t) .t.1 + 3(1 – t).t .3 + t .4 = –2t + 3t + 3t .
3 2 2 3 3 2
3 2
= 15t – 24t + 6t + 3 .
The control points and the graph of B(t) = ( x(t), y(t) ) are shown in Fig. 7.
(1) B(0) = P0 and B(1) = P3 so the Bezier curve goes through the points P0 and P3 .
This property guarantees that B(t) goes through specified points. If we want two Bezier
curves to fit together, it is important that the value at the end of one curve matches the starting
value of the next curve. This property guarantees that we can control the values of the Bezier
curves at their endpoints by choosing appropriate values for the control points P0 and P3 .
This is an important property because it guarantees that B(t) is continuous and differentiable at
each point so its graph is connected and smooth at each point. It also guarantees that the graph
of B(t) does not "wiggle" too much between control points.
(3) B '(0) = slope of the line segment from P0 to P1: B '(1) = slope of the line segment from P2 to P3.
This is an important property because it means we can match the ending slope of one curve with
the starting slope of the next curve to result in a smooth connection. We can see in Fig. 6 that the
dotted line from P0 to P1 is tangent to the graph of B(t) at the point P0 .
(4) For 0 ≤ t ≤ 1, the graph of B(t) is in the region whose corners are the control points.
Example 3: Find a formula for a Bezier curve that goes through the
points (1, 1) and (0,0) and is shaped like an "S."
Solution: Since we want the curve to begin at the point (1,1) and end
at (0,0) we can put P0 = (1,1) and P3 = (0,0). A little experimentation
with values for P1 and P2 indicates that P1 = (–1, 2) and
P2 = (2, –1) gives a mediocre "S" shape (Fig. 9). Then the formula for
B(t) is
for 0 ≤ t ≤ 1 , and
x(t) = (1 – t) .x0 + 3(1 – t) .t.x1 + 3(1 – t).t .x2 + t .x3 = (1–t) .1 + 3(1–t) .t.(–1) + 3(1–t).t .2 + t .0
3 2 2 3 3 2 2 3
and
y(t) = (1 – t) .y0 + 3(1 – t) .t.y1 + 3(1 – t).t .y2 + t .y3 = (1–t) .1 + 3(1–t) .t.2 + 3(1–t).t .(–1) + t .0
3 2 2 3 3 2 2 3
Practice 3: Find a formula for a Bezier curve that goes through the points (0, 0) and (0,1) and is shaped like
a "C."
Example 4: Find a formula for a Bezier curve that goes through the point (0, 5) with a slope of 2 and
through the point (6, 1) with a slope of 3.
Solution: Since we want to curve to begin at (0,5) and end at (6,1), we put
P0 = (0,5) and P3 = (6,1). To get the slopes we need to pick P1 so the
slope of the line segment from P0 to P1 is 2: going "over 1 and up 2"
to get P1 = (1,7) works fine as do several other points. Similarly, to get
the right slope at P3 we can go "back 1 and down 3" to get P2 = (5, –2). The
Bezier curve for P0 = (0,5), P1 = (1,7), P2 = (5,–2), and P3 = (6,1) is
specified in the problem: the choice of which one you use depends on the other
properties of the shape that you want the curve to have.
Practice 4: Find a formula for a Bezier curve that goes through the point
(1, 3) with a slope of –2 and through the point (5, 3) with
a slope of –1.
Example 5: Find formulas for a pair of Bezier curves so that the first starts at
the point A = (0,3) with slope 2, the second ends at the point
C = (7,2) with slope 1, and the curves connect at the point
B = (4,6) with slope 0.
9.4.5 Bezier Curves Contemporary Calculus 6
Solution: For the first Bezier curve B(t) take P0 = A = (0,3), P1 = (1,5) (to get the slope 2),
P3 = B = (4,6), and P2 = (3,6) (to get the slope 0 at the connecting point). Then,
For the second Bezier curve C(t) take P0 = B = (4,6), P1 = (5,6) (to get the slope 0 at
the connecting point), P3 = C = (7,2), and P2 = (6,1) (to get the slope 1). Then,
Typically a designer sketches a crude shape for an object and then moves certain points to locations specified by
the plans. Sometimes the designer adds additional points along the curve to "fix" the location of the curve.
These "fixed" points along the curve become the endpoints P0 and P3 for each of the sections of the curve
that will be described by a Bezier formula. Then, for each section of the curve, the designer visually
experiments with different locations of the interior control points P1 and P2 to get the shape "just right."
Meanwhile, the computer program adjusts the formulas for the Bezier curves based on the current locations of
the control points for each section, and, when the design is complete, saves the locations of the control points.
You may never need to calculate the formulas for Bezier curves
(outside of a mathematics class), but if you do any computer–aided
design work you will certainly be using these curves. And the ideas
and formulas for Bezier curves in two dimensions extend very easily
and naturally to describe paths in three dimensions such as the route of
a highway exit ramp (Fig. 14) or the path of a hydraulic hose for the
landing gear of an airplane.
9.4.5 Bezier Curves Contemporary Calculus 7
The first idea is the parametric representation of a line segment from point
PA to PB as L(t) = (1 – t).PA + t.PB for 0 ≤ t ≤ 1.
This parametric pattern for a line is used in the construction of a Bezier curve.
To construct the Bezier curve for the four control points P0, P1, P2, and
P3 we start by fixing a value of t between 0 and 1. Then we find the
point L0(t) along the parametric line from P0 to P1, the point L1(t)
along the parametric line from P1 to P2, and the point L2(t) along the
parametric line from P2 to P3 (Fig. 16):
For the fixed value of t, we then find the point M0(t) along the parametric
line from the point L0(t) to the point L1(t), and the point M1(t) along the
parametric line from the point L1(t) to the point L2(t) (Fig. 17):
For the same fixed value of t, we finally find the point B(t) along the
parametric line from the point M0(t) to the point M1(t) (Fig. 18):
Fig. 19 shows these points and lines for several values of t between 0 and 1.
We can use the previous geometric construction to obtain the formula for
B(t) given in the definition of Bezier curves by working backwards from
B(t) = (1 – t).M0(t) + t. M1(t) :
B(t) = (1 – t). M0 + t. M1
= (1 – t).{ (1 – t).L0 + t.L1} + t.{ (1 – t).L1 + t.L2} replacing M0 and M1 in terms
of L0 , L1 and L2
= (1 – t) .L0 + 2(1 – t).t.L1 + t .L2
2 2
simplifying
2.
= (1 – t) { (1 – t).P0 + t.P1 } + 2(1 – t).t.{ (1 – t).P1 + t.P2 } 2.
+ t { (1 – t).P2 + t.P3 }
replacing L0, L1 and L2 in terms
of P0 , P1 , P2 and P3
= (1 – t) .P0 + 3(1 – t) .t.P1 + 3(1 – t).t .P2 + t .P3
3 2 2 3
simplifying
Property (2) is clear from the defining formula for B(t), or we can expand the powers of 1 – t
and t and collect the similar terms to rewrite B(t) as
B(t) = (–P0 + 3P1 – 3P2 + P3).t + (3P0 – 6P1 + 3P2).t + (–3P0 + 3P1).t + ( P0 ).
3 2
Property (3) can be verified using the rewritten form from Property 2,
x(t) = (–x0 + 3x1 – 3x2 + x3).t + (3x0 – 6x1 + 3x2).t + (–3x0 + 3x1).t + ( x0 ) and
3 2
y(t) = (–y0 + 3y1 – 3y2 + y3).t + (3y0 – 6y1 + 3y2).t + (–3y0 + 3y1).t + ( y0 ).
3 2
d x(t)
= 3(–x0 + 3x1 – 3x2 + x3).t + 2(3x0 – 6x1 + 3x2).t + (–3x0 + 3x1) and
2
Then dt
d y(t)
= 3(–y0 + 3y1 – 3y2 + y3).t + 2(3y0 – 6y1 + 3y2).t + (–3y0 + 3y1) .
2
dt
d x(t) d x(t)
When t = 0, dt = –3x0 + 3x1 = –3(x1 – x0) and dt = –3(y1 – y0) so
The verification that B '(1) equals the slope of the line segment from P2 to P3 is similar:
y '(1)
evaluate x '(1), y '(1) and B '(1) = x '(1) .
9.4.5 Bezier Curves Contemporary Calculus 9
We will not verify Property (4) here, but it follows from the fact that each point on the Bezier curve is a
"weighted average" of the four control points. For 0 ≤ t ≤ 1, each of the coefficients (1–t) , 3(1–t) .t,
3 2
3(1–t).t and t is between (or equal to) 0 and 1, and they always add up to 1 (just expand the
2 3
Problems
In problems 1 – 6, pairs of points, PA and PB , are given. In each problem (a) sketch the line segment L
from PA and PB , and (b) plot the locations of the points L(0.2), L(0.5), and L(0.9) on the line segment in
part (a). Finally, (c) determine the equation of the line segment L(t) from PA and PB and graph it.
1. PA and PB are given in Fig. 20. 2. PA and PB are given in Fig. 21.
3. PA and PB are given in Fig. 22. 4. PA and PB are given in Fig. 23.
7. Show that the parametric equations for the line segment given in Example 1,
x(t) = (1 – t).x0 + t.x1 and y(t) = (1 – t).y0 + t.y1 for 0 ≤ t ≤ 1 ,
In problems 8 – 13, find the parametric equations for a Bezier curve with the given control points or the given
properties.
8. P0 = (1, 0), P1 = (2, 3), P2 = (5, 2), P3 = (6, 3) 9. P0 = (0, 5), P1 = (2, 3), P2 = (1, 4), P3 = (4, 2)
10. P0 = (5, 1), P1 = (3, 3), P2 = (3, 5), P3 = (2, 1) 11. P0 = (6, 5), P1 = (6, 3), P2 = (2, 5), P3 = (2, 0)
12. P0 = (0, 1), P3 = (4, 1) and B '(0) = 1, B '(1) = –3 13. P0 = (5, 1), P3 = (1, 3) and B '(0) = 2, B '(1) = 3
9.4.5 Bezier Curves Contemporary Calculus 10
In problems 14 – 17, sets of control points P0, P1, P2, and P3 are shown. Sketch a reasonable Bezier curve for the
14. P0, P1, P2, and P3 are given in Fig. 24. 15. P0, P1, P2, and P3 are given in Fig. 25.
16. P0, P1, P2, and P3 are given in Fig. 26. 17. P0, P1, P2, and P3 are given in Fig. 27.
In problems 18 – 21, sets of control points P0, P1, P2, and P3 are shown as well as a curve C(t). For each problem
explain why we can be certain that C(t) is NOT the Bezier curve for the given control points (state
which property or properties of Bezier curves C(t) does not have).
18. P0, P1, P2, and P3 are given in Fig. 28. 19. P0, P1, P2, and P3 are given in Fig. 29.
20. P0, P1, P2, and P3 are given in Fig. 30. 21. P0, P1, P2, and P3 are given in Fig. 31.
In problems 22 – 23, find a pair of Bezier curves that satisfy the given conditions.
22. B(0) = (0, 5), B '(0) = 2, B(1) = C(0) = (3, 1), B '(1) = C '(0) = 2, C(1) = (6, 2), and C '(1) = 4.
23. B(0) = (0, 5), B '(0) = 2, B(1) = C(0) = (3, 1), B '(1) = C '(0) = 2, C(1) = (6, 2), and C '(1) = 4
9.4.5 Bezier Curves Contemporary Calculus 11
The following Applications illustrate just a few of the wide variety of design applications of Bezier curves.
This combination of differentiation and algebra is very powerful.
Applications
For each of the following applications, write the equation of a Bezier curve B(t) that satisfies the
requirements of the application, and then use your calculator/computer to graph B(t).
(Typically in these applications, the starting and ending points, P0 and P3, are specified, but several
choices of the control points P1 and P2 meet the requirements of the application. Select P1 and P2 so
the resulting graph of B(t) satisfies the requirements of the application and is also "visually pleasing.")
2. To design the exit ramp on a highway (Fig. 34), you need to find the
equation of a Bezier curve so that at the beginning of the exit the elevation is 20 feet with a slope
of –0.05 (about 3°), and 600 feet later, measured horizontally, the elevation is 0 feet and the ramp
is horizontal.
9.4.5 Bezier Curves Contemporary Calculus 12
5. Find two Bezier curves B(t) and C(t) that describe the
pieces of the curve for the top half of the hull of the
Concordia Yawl that is 40 feet long, has a beam of 10
feet, and a transom width of 2 feet (Fig. 37).
Final Note: The examples and applications given here have consisted of only one or two Bezier
curves, and they are intended only as an introduction to the ideas and techniques of fitting Bezier
curves to particular situations. But these ideas extend very nicely to curves that require pieces of
several different Bezier curves for a good fit (Fig. 38) and even to curves and surfaces in three
dimensions. Unfortunately, the systems of equations tend to grow very large for these extended
applications.
9.4.5 Bezier Curves Contemporary Calculus 13
Practice Answers
Practice 2: P0 = (0, 4), P1 = (1, 2), P2 = (4, 2), and P3 = (4, 4). Then
The control points and the graph of B(t) = ( x(t), y(t) ) are shown in Fig. 39.
The control points and the graph of B(t) = ( x(t), y(t) ) are shown in Fig. 40.
Other choices for P1 and P2 can also yield correct slopes, and then we