Graphics Reference
In-Depth Information
3.5
Lines, Rays, and Segments
A
line L
can be defined as the set of points expressible as the linear combination of
two arbitrary but distinct points
A
and
B
:
L
(
t
)
=
(1
−
t
)
A
+
tB
.
Here,
t
ranges over all real numbers,
. The
line segment
(or just
segment
)
connecting
A
and
B
is a finite portion of the line through
A
and
B
, given by limiting
t
to lie in the range 0
−∞
<
t
<
∞
1. A line segment is
directed
if the endpoints
A
and
B
are
given with a definite order in mind. A
ray
is a half-infinite line similarly defined, but
limited only by
t
≤
t
≤
≥
0. Figure 3.11 illustrates the difference among a line, a ray, and a
line segment.
By rearranging the terms in the parametric equation of the line, the equivalent
expression
L
(
t
)
=
A
+
t
v
(where
v
=
B
−
A
)
is obtained. Rays, in particular, are usually defined in this form. Both forms are referred
to as the parametric equation of the line. In 3D, a line
L
can also be defined implicitly
as the set of points
X
satisfying
(
X
v
=
−
A
)
×
0,
where
A
is a point on
L
and
v
is a vector parallel to
L
. This identity follows, because
if and only if
X
A
is parallel to
v
does the cross product give a zero vector result
(in which case
X
lies on
L
, and otherwise it does not). In fact, when
v
is a unit vector
−
B
B
B
L
(
t
),-
∞
<
t
<
∞
L
(
t
),0
≤
t
L
(
t
),0
≤
t
≤
1
A
A
A
(a)
(b)
(c)
Figure 3.11
(a) A line. (b) A ray. (c) A line segment.