Dot Product of Vectors
Consider the vectors A and B (with respective magnitudes of |A| and |B|). If these vectors enclose an angle θ then their dot product can be written as:
A·B = |A| |B| cos(θ)
If the vectors can be written as:
A = (Ax, Ay,
Az)
B = (Bx, By, Bz)
B = (Bx, By, Bz)
then the dot product is given by:
A·B = AxBx + AyBy + AzBz
Example
#1:
(1, 4, 2) · (3, 4, 2) = 1(3) + 4(4) + 2(2) = 23
Example
#2:
(0, 4, 2) · (3, 0, 0) = 0(3) + 4(0) + 2(0) = 0