Game Development Reference
In-Depth Information
Before we switch to the second interpretation of the dot product, let's
check out one more very common use of the dot product as a projection.
Assume once more that a is a unit vector and b has arbitrary length. Using
the dot product, it's possible to separate b into two values, b and b
(read “ b parallel” and “ b perp”), which are parallel and perpendicular to
a , respectively, such that b = b + b . Figure 2.24 illustrates the geometry
involved.
Figure 2.24
Projecting one vector onto
another
We've already established that the length of b will be equal to a b .
But the dot product yields a scalar, and b is a vector, so we'll take the
direction specified by the unit vector a and scale it up:
b = ( a b ) a .
Once we know b , we can easily solve for b :
b + b = b ,
b = b
b ,
b = b − ( a b ) a .
It's not too di cult to generalize these results to the case where a is
not a unit vector.
In the rest of this topic, we make use of these equations several times
to separate a vector into components that are parallel and perpendicular
to another vector.
Now let's examine the dot product through the lens of trigonometry.
This is the more common geometric interpretation of the dot product, which
places a bit more emphasis on the angle between the vectors. We've been
thinking in terms of projections, so we haven't had much need for this angle.
Less experienced and conscientious authors [16] might give you just one of
the two important viewpoints, which is probably su cient to interpret an
equation that contains the dot product. However, a more valuable skill is
Search WWH ::




Custom Search