An important vector operation in linear algebra is the dot product. A dot product takes two equal dimension vectors and returns a single scalar value by summing the products of the vectors’ corresponding components. This can be written out formulaically as:
The dot product operation is both commutative (a · b = b · a) and distributive (a · (b+c) = a · b + a · c).
The resulting scalar value represents how much one vector “goes into” the other vector. If two vectors are perpendicular (or orthogonal), their dot product is equal to 0, as neither vector “goes into the other.”
Let’s take a look at an example dot product. Consider the following two vectors:
To find the dot product between these two vectors, we do the following:
The dot product can also be used to find the magnitude of a vector and the angle between two vectors. To find the magnitude, we can reference Exercise 2 and see that the magnitude of a vector is simply the square root of a vector’s dot product with itself.
To find the angle between two vectors, we rely on the dot product between the two vectors and use the following equation.
Let’s look at the same two vectors from above:
To find the angle between these two vectors, we do the following:
Solving this, we end up with:
We have another exciting vector applet for you! This time this one shows the dot product and angle between two vectors. Play around with it to get a sense of how it works.
Using the applet, attempt to do the following:
- Find two vectors that are orthogonal (perpendicular to each other).
- Figure out when the dot product between two vectors is highest. (Hint: when does a vector “go into” another vector the most?)
Now let’s use it to help with the following practice problem.
Find the dot product and angle between the following sets of vectors:
Does your answer correspond to what you find in the applet? (Note: it may be tough to get to the exact values, but you can use approximate values to check your answer!)