Graphics Reference
In-Depth Information
B.3.2
Parametric Curves
In addition to implicit equations, curves in 2D can also have parametric coor-
dinates. These are curves that are controlled by a single real parameter. For
example, the position of a point that changes with time t can be described by two
functions x
. The parameter can also just be a
way to put a coordinate system on the curve, like mileage markers on a highway.
An example of a parametric curve is the circle with parameter
(
t
)
and y
(
t
)
, or in vector terms P
(
t
)
θ
:
P
( θ )=[
x
( θ )
y
( θ )] = [
x c +
R cos
θ
y c +
R sin
θ ] .
If any
θ
is allowed, the same point can be generated by many
θ
s. For example,
P
for a unit radius circle centered at the origin.
Often we restrict the parameters to a finite interval (e.g.,
(
0
)=
p
(
2
π )=
p
(
2
π )=(
1
,
0
)
π < θ π
for the
circle).
We can also write a parametric coordinate for a line through points C and D .
Note that vector addition tells us that D
=
C
+(
D
C
)
where, ( D
C )isthe
(
)
vector from C to D . We can also add on a scaled copy of
D
C
: the vector
s
where s is a fraction between 0 and 1 gets us part way from C to D .For
example, C
(
D
C
)
+
0
.
5
(
D
C
)
gets us halfway between C and D . In general, we have
P
(
s
)=
c
+
s
(
D
C
)
So given any s between 0 and 1, we get a point P . p
D .For s
values less than zero we still get points on the line, but points on the “ C side” of
the line. For s greater than 1 we get points on the D side of the line.
(
0
)=
C and P
(
1
)=
B.3.3
Parametric Curves and Implicit Surfaces in 3D
In 3D we also have implicit equations. Although in 2D these define “zero curves”
that divide 2D space into positive and negative areas, in 3D we have “zero sur-
faces” that divide 3D space into positive and negative volumes. An implicit sphere
is an example of a 3D implicit equation:
R 2
(
P
C
) · (
P
C
)
=
0
.
Interestingly, this is exactly the same formula as for the 2D implicit circle! The
difference is that the vectors P and C are 3D as opposed to 2D. The geometry
behind the formula is the same: any point P a distance R from C is on the sphere.
The implicit equation for a plane is analogous to the 2D implicit equation for
the line. Given a point C on the plane with surface normal N , the test for whether
Search WWH ::




Custom Search