You are on page 1of 4

Quadratic Bezier Curves by the De Casteljau Algorithm

We will construct what is called the quadratic Bezier curve by means of a geometric algorithm.
First, draw segments AB and BC and relabel as A1, A2, A3. (Discover the RELABEL command in Display if you have
not done so; it will save you time.) Construct the point B1 as a point on segment A1A2.
Measure the ratio A1B1/A1A2. We will think of this ratio as t, so you may want to repeat the measurement and relabel it
as t as in the figure.
Select the ratio t and choose Mark Scale Factor in the Transform menu. Then Mark A2 as center and dilate point A3 to
get A3', which we relabel as B2.
Next construct segment B1B2 and construct point C1 on the segment by dilating B2 with center B1 and ratio t.
Now if you drag B1 all the points B2 and C1 should move "in tandem" with the same barycentric coordinates on their
respective segments. You can create an animation button for B1 on segment A1A2 if you like.
Now construct the locus of C1 by selecting C1 and B1 and choosing Locus on the Construct menu.
Finally, hide the points B1,B2,C1 and segment B1B2 and the ratio. Select the figure, including the locus and Make a
Script. Check in a new Sketch that this figure constructs the locus. In a new figure draw points A, B, C, D, E and
construct two Bezier curves given by A, B, C and also C, D, E. Notice that they do not fit together very smoothly unless
B, C and D are collinear.
Write down the formula in terms of the barycentric coordinates (1-t) and t of points B1, B2 with respect to the triangle
A1A2A3. What are the barycentric coordinates of C1? Do they add up to 1?
Cubic Bezier Curves by the De Casteljau Algorithm
We will construct what is called the cubic Bezier curve by taking the previous construction a step further.
Draw points A1, A2, A3, A4 in a new sketch and construct point B1 as a point on segment A1A2.
Measure the ratio A1B1/A1A2 as before and call it t. Mark Scale Factor as t.
With this notation, B1 = (1-t)A1+tA2. Construct the points B2 = (1-t)A2 + t A3 by dilating A3 with center A2 and ratio t.
Construct B3 on segment A3A4 in the same way.
Now you have points B1, B2, B3 that all move according to ratio t. But B1, B2, B3 forms a figure like the A1, A2, A3 of
the quadratic case. So complete the construction of new points as you did in that case, to get C1, C2 and also D1, all
with dilations using the same ratio t but different centers.
Finally, select point D1 and point B1 and choose Locus from the Construct menu. If you hide the construction and the
ratio, you can select the locus and the points A1, A2, A3, A4 and make a script that will draw the locus. Reorder the
Givens if necessary to have the order A1, A2, A3, A4. (Do this by dragging in the Script window while you hold down
the Shift Key.
Now apply the script to see how cubics are used in computer graphics. In a new sketch, draw points P1, P2, Q1, Q2, R1,
R2. Construct Q2' by rotating Q2 by 180 degrees with center Q1. Now apply the script first to P1, P2, Q2', Q1 and then
Q1, Q2, R1, R2. See how the cubics fit together.

Area, shears and affine mappings
We will investigate the areas of parallelograms in (x,y) space.
In a new sketch, show the axes and then construct a parallelogram as in the figure, with one vertex at O, the origin, one at A and
one at B as shown. The fourth vertex S has position vector A+B. But sure to have the whole line BS, not just the segment.
Construct a point C on this line.

Now relabel Point C as B1.
Mark vector OA and translate B1 by this
vector to get new point S1. Construct the
sides and interior of this new parallelogram
OAS1B1.
Explain why the new parallelogram has the
same area as the old parallelogram OASB.
Now suppose A = (a,b) and B = (c,d). If we
drag B1 so that B1 is on the y-axis, what are
the coordinates of B1.
In this case, what are the coordinates of S1?
If we take OB1 as the base of this
parallelogram, what is the base and what is
the height?
What is the area of OAS1B1? This should
be a formula in terms of a, b, c, d. This is
also the area of OASB, or the parallelogram,
with sides OA, and OB. Do you see the
determinant?
A shear is an affine transformation that leaves one line m fixed and moves some point B to another pont B1 so that BB1 is
parallel to m. This means all lines parallel to m along themselves. The example above was a shear. If we think in terms of affine
coordinates, a point with affine coordinates (x,y) in terms of the axes OA and OB is mapped to a point P' with the same
coordinates in terms of OA and OB1.
Add to the figure a point P and figure out how to construct P'
Explain how the parallelogram OAS1B1 (when B1 is on the y-axis) can be sheared in a vertical direction into a rectangle with
sides parallel to the axes. This means that any affine transformation is a product of two shears and a scaling parallel to the x and
y axes (a strain).