Game Development Reference
In-Depth Information
Figure 2.18. Sign of the dot product
In other words, the sign of the dot product can give us a rough classifi-
cation of the relative directions of the two vectors. Imagine a line (in 2D)
or plane (in 3D) perpendicular to the vector a . The sign of the dot product
a
b tells us which half-space b lies in. This is illustrated in Figure 2.19.
Figure 2.19
The sign of the dot product gives a
rough classification of the relative
orientation of two vectors.
Next, consider what happens when we scale b by some factor k. As
shown in Figure 2.20, the length of the projection (and thus the value of
the dot product) increases by the same factor. The two triangles have equal
interior angles and thus are similar. Since the hypotenuse on the right is
longer than the hypotenuse on the left by a factor of k, by the properties
of similar triangles, the base on the right is also longer by a factor of k.
Let's state this fact algebraically and prove it by using the formula:
a (k b ) = a x (kb x ) + a y (kb y ) + a z (kb z )
= k(a x b x + a y b y + a z b z )
= k( a b ).
Dot product is
associative with
multiplication by a scalar
 
Search WWH ::




Custom Search