Game Development Reference
In-Depth Information
omit the multiplication symbol when multiplying two scalars or a scalar
and a vector, we must not omit the dot symbol when performing a vector
dot product. If you ever see two vectors placed side-by-side with no symbol
in between, interpret this according to the rules of matrix multiplication,
which we discuss in Chapter 4. 7
The dot product of two vectors is the sum of the products of corre-
sponding components, resulting in a scalar:
2
4
3
5
2
4
3
5 = a 1 b 1 + a 2 b 2 + + a n−1 b n−1 + a n b n .
a 1
a 2
.
a n−1
a n
b 1
b 2
.
b n−1
b n
Vector dot product
This can be expressed succinctly by using the summation notation
n
a b =
a i b i .
Dot product using
summation notation
i=1
Applying these rules to the 2D and 3D cases yields
a b = a x b x + a y b y
( a and b are 2D vectors),
2D and 3D dot products
a b = a x b x + a y b y + a z b z
( a and b are 3D vectors).
Examples of the dot product in 2D and 3D are
4
6
−3
7
= (4)(−3) + (6)(7) = 30,
2
3
2
3
−2
7
0
−1
4
5
4
5
= (3)(0) + (−2)(4) + (7)(−1) = −15.
It is obvious from inspection of the equations that vector dot product
is commutative: a b = b a . More vector algebra laws concerning the dot
product are given in Section 2.13.
2.11.2 Geometric Interpretation
Now let's discuss the more important aspect of the dot product: what
it means geometrically. It would be di cult to make too big of a deal
7 One notation you will probably bump up against is treating the dot product as an
ordinary matrix multiplication, denoted by a T b if a and b are interpreted as column
vectors, or ab T for row vectors. If none of this makes sense, don't worry, we will repeat
it after we learn about matrix multiplication and row and column vectors in Chapter 4.
 
Search WWH ::




Custom Search