# 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:

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

If the vectors can be written as:

${\displaystyle \mathbf {U} =(U_{x},U_{y},U_{z})}$
${\displaystyle \mathbf {V} =(V_{x},V_{y},V_{z})}$

then the dot product is given by:

${\displaystyle \mathbf {U} \cdot \mathbf {V} =U_{x}V_{x}+U_{y}V_{y}+U_{z}V_{z}}$

For example,

${\displaystyle (1,2,3)\cdot (2,2,2)=1(2)+2(2)+3(2)=12.}$

and

${\displaystyle (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

${\displaystyle |\mathbf {U} |={\sqrt {U_{x}^{2}+U_{y}^{2}+U_{z}^{2}}}}$

and

${\displaystyle |\mathbf {V} |={\sqrt {V_{x}^{2}+V_{y}^{2}+V_{z}^{2}}}}$

this means that

${\displaystyle \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}}}}}}$