i
i
i
i
i
i
i
i
15
Michael Gleicher
Curves
15.1 Curves
Intuitively, think of a curve as something you can draw with a pen. The curve is
the set of points that the pen traces over an interval of time. While we usually
think of a pen writing on paper (e.g., a curve that is in a 2D space), the pen could
move in 3D to generate a space curve, or you could imagine the pen moving in
some other kind of space.
Mathematically, denitions of curve can be seen in at least two ways:
1. The continuous image of some interval in an n-dimensional space.
2. A continuousmap from a one-dimensionalspace to an n-dimensionalspace.
Both of these denitions start with the idea of an interval range (the time over
which the pen traces the curve). However, there is a signicant difference: in
the rst denition, the curve is the set of points the pen traces (the image), while
in the second denition, the curve is the mapping between time and that set of
points. For this chapter, we use the rst denition.
A curve is an innitely large set of points. The points in a curve have the
property that any point has two neighbors, except for a small number of points
that have one neighbor (these are the endpoints). Some curves have no endpoints,
either because they are innite (like a line) or they are closed (loop around and
connect to themselves).
339
i
i
i
i
i
i
i
i
340 15. Curves
Because the “pen” of the curve is thin (innitesimally), it is difcult to create
lled regions. While space-lling curves are possible (by having them fold over
themselves innitely many times), we do not consider such mathematical oddities
here. Generally, we think of curves as the outlines of things, not the “insides.
The problem that we need to address is how to specify a curve—to give a
name or representation to a curve so that we can represent it on a computer. For
some curves, the problem of naming them is easy since they have known shapes:
line segments, circles, elliptical arcs, etc. A general curve that does not have a
“named” shape is sometimes called a free-form curve. Because a free-form curve
can take on just about any shape, they are much harder to specify.
There are three main ways to specify curves mathematically:
1. Im plicit curve representations dene the set of points on a curve by giving a
procedure that can test to see if a point in on the curve. Usually, an implicit
curve representation is dened by an implicit function of the form
f(x, y)=0,
so that the curve is the set of points for which this equation is true. Note that
the implicit function f is a scalar function (it returns a single real number).
2. Parametric curve representations provide a mapping from a free parameter
to the set of points on the curve. That is, this free parameter provides an
index to the points on the curve. The parametric form of a curve is a func-
tion that assigns positions to values of the free parameter. Intuitively, if you
think of a curve as something you can draw with a pen on a piece of paper,
the free parameter is time, ranging over the interval from the time that we
began drawing the curve to the time that we nish. The parametric function
of this curve tells us where the pen is at any instant in time:
(x, y)=f(t).
Note that the parametric function is a vector-valued function. This example
is a 2D curve, so the output of the function is a 2-vector; in 3D it would be
a 3-vector.
3. Generative or procedural curve representations provide procedures that can
generate the points on the curve that do not fall into the rst two categories.
Examples of generative curve descriptions include subdivision schemes and
fractals.
Remember that a curve is a set of points. These representations give us ways
to specify those sets. Any curve has many possible representations. For this

Get Fundamentals of Computer Graphics, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.