Math 326, March 24 -
Bezier Curves
Bezier curves are a convenient way to produce a nice curve from a
finite list of points. These control points can be adjusted to
change the shape of the curve. The process for generating the
curve from these points is fairly complicated and can be followed in
the book (Section 5.3).
Additional Questions
- Add a second curve to your graph. We want to make the two
curves connect smoothly. To do this, set the last control point
from the first curve and the first control point from the second curve
to both be the midpoint between the second last point from the first
curve and the second point from the second curve. That is, (Pt 4
Cu 1) = (Pt 1 Cu 2) = ((Pt 3 Cu 1)+(Pt 2 Cu 2))/2.
- Add a third curve. Again make the common endpoint between
the second and third curves a midpoint. Now we have eight control
points we can move, 3 from the first, 2 from the second and 3 from the
third curves (the others are fixed to be midpoints). Try
experimenting, making different shapes. For example, setting the
8 points we can choose to
[(3,9),(4.33,5),(3,-3),(1.6,5),(2.73,11),(7,6.8),(5,3),(3,4)] and
[(1.42,9),(4.03,8.1),(5.75,9.6),(3.83,11),(6.19,4.1),(3.99,1.8),(2.2,1.7),(1.01,4)]
you get a fair approximation of the two letters P and T.
- Morphing - Record the
control points for two pictures. Let's create a scroll bar to
morph one picture into the other. First, save a copy of your
spreadsheet, as we are going to change some things and it won't be easy
going back. Now, create columns for starting control points and
ending control points. The points which get entered into the
model to create the curves will be a weighted average of these sets of
points. If s denotes
the starting coordinate and e
denotes the ending coordinate, then (1-r)*xs
+ r*xe = xave. r is the weight for the average,
and it should range from 0 to 1 (in steps of 0.01) by way of a scroll
bar.