Game Development Reference
In-Depth Information
First, from planar geometry, we know
that the area of the parallelogram is bh,
the product of the base and the height.
(In Figure 2.28, the base is b = b .) We
can verify this rule by “clipping” off a tri-
angle from one end and moving it to the
other end, forming a rectangle, as shown
in Figure 2.29.
The area of a rectangle is given by its
length and width. In this case, this area
is the product bh. Since the area of the
rectangle is equal to the area of the par-
allelogram, the area of the parallelogram
must also be bh.
Returning to Figure 2.28, let a and b
be the lengths of a and b , respectively, and
Figure 2.29
Area of a parallelogram
note that sinθ = h/a. Then
A = bh
= b(asinθ)
=
sinθ
= a × b .
a
b
If a and b are parallel, or if a or b is the zero vector, then a × b = 0 . So
the cross product interprets the zero vector as being parallel to every other
vector. Notice that this is different from the dot product, which interprets
the zero vector as being perpendicular to every other vector. (Of course, it
is ill-defined to describe the zero vector as being perpendicular or parallel
to any vector, since the zero vector has no direction.)
We have stated that a × b is perpendicular to a and b . But there are two
directions that are perpendicular to a and b —which of these two directions
does a × b point? We can determine the direction of a × b by placing the
tail of b at the head of a , and examining whether we make a clockwise
or counterclockwise turn from a to b . In a left-handed coordinate system,
a × b points towards you if the vectors a and b make a clockwise turn from
your viewpoint, and away from you if a and b make a counterclockwise
turn. In a right-handed coordinate system, the exact opposite occurs: if a
and b make a counterclockwise turn, a × b points towards you, and if a
and b make a clockwise turn, a × b points away from you.
Figure 2.30 shows clockwise and counterclockwise turns. Notice that to
make the clockwise or counterclockwise determination, we must align the
Search WWH ::




Custom Search