Vector a is (4, 4, 4)T Vector b is (4, 0, 4)T Calculate: au · bu = cosθ
|a| = √(16 + 16 + 16) = 4√3 , |b| = √(16 + 16) = 4√2
au = (4, 4, 4)T/(4√3) , bu = (4, 0, 4)T/(4 √2 )
au · bu = (16 + 16)/( (4√3)(4 √2) ) = 2/(√3√2 ) = √2 /√3 = cosθ
cosθ = 0.81649,
θ = 35.26°
vector f: | vector g: |
(2,4,6)T | (6,4,3)T |
The nasty math in the previous exercise is not the real purpose of all this. The goal is to illustrate the formula au · bu = cosθ , which is important in every part of 3D graphics. It is worth another example.
The figure shows two vectors, represented by:
f = (2, 4, 6)T g = (6, 4, 3)T
Rotate the figure to get a better sense of the angle between the vectors. You would like to measure this angle by laying a protractor flat across the two vectors. But you can't do this since all you see is the projection of the two vectors onto the screen.
Guessing, however, is easy. About what angle separates the two vectors?