The dot product is a mathematical operation that produces a scalar quantity (i.e., a quantity with magnitude only, no direction) by taking the product of the components of the input vectors and summing them. It is defined by the following formula:
where A and B are the input vectors, and and are the components of the vectors.
Example
In our example, the dot product of vectors A and B is calculated as follows:
Once we have calculated the dot product of the vectors, we can use it to calculate the angle between vectors using the following formula:
where θ is the angle between the vectors, is the dot product of the vectors, and and are the magnitudes of the vectors. In our example, we substitute the values we have calculated into this formula to get the following:
degrees
This means that the angle between vectors A and B is 57.22 degrees.