Last modified on 13 January 2011, at 13:55

Trigonometry/Vectors and Dot Products

Consider the vectors U and V (with respective magnitudes |U| and |V|). If those vectors enclose an angle θ then the dot product of those vectors can be written as:


\mathbf{U}\cdot\mathbf{V} = |\mathbf{U}||\mathbf{V}| \cos(\theta)

If the vectors can be written as:

\mathbf{U} = (U_x, U_y, U_z)
\mathbf{V} = (V_x, V_y, V_z)

then the dot product is given by:

\mathbf{U}\cdot\mathbf{V} = U_x V_x + U_y V_y + U_z V_z

For example,

(1, 2, 3) \cdot (2, 2, 2) = 1 (2) + 2 (2) + 3 (2) = 12.

and

(0, 5, 0) \cdot (4, 0, 0) = 0.

We can interpret the last case by noting that the product is zero because the angle between the two vectors is 90 degrees.

Since

|\mathbf{U}| = \sqrt{U_x^2+U_y^2+U_z^2}

and

|\mathbf{V}| = \sqrt{V_x^2+V_y^2+V_z^2}

this means that

\cos(\theta) = \frac{U_x V_x + U_y V_y + U_z V_z}{{\sqrt{U_x^2+U_y^2+U_z^2}}{\sqrt{V_x^2+V_y^2+V_z^2}}}