Game Development Reference
In-Depth Information
v = v −v
2
4
3
5
2
4
3
5
2
4
3
5
2
4
3
5
4
−1
7/2
7/2
0
4−7/2
3−7/2
−1−0
1/2
−1/2
−1
=
=
=
11. Define a triangle using the vectors a, b, and a − b, and let θ be the angle between a and
b. Then the squared length of the edge a−b is:
a−b 2
= (a−b)(a−b)
= aa−2ab + bb
= aa + bb−2ab
= a 2 +b 2 −2abcos θ
which is the law of cosines.
12. First, let's obtain some information about the vector components.
From the figure, we have
a x = acos θ a , a y = asin θ a ,
b x = bcos θ b , b y = bsin θ b .
Now we can proceed with the algebraic definition of the dot product and the cosine differ-
ence identity:
ab = a x b x + a y b y
= acos θ a bcos θ b +asin θ a bsin θ b
= ab(cos θ a cos θ b + sin θ a sin θ b )
= abcos (θ b −θ a )
= abcos θ.
Search WWH ::




Custom Search