Learn about the dot product and how it measures the relative direction of two vectors.
The dot product is a fundamental way we can combine two vectors. Intuitively, it tells us something about how much two vectors point in the same direction.
Definition and intuition
We write the dot product with a little dot between the two vectors (pronounced "a dot b"):
If we break this down factor by factor, the first two are and . These are the magnitudes of and , so the dot product takes into account how long vectors are. The final factor is , where is the angle between and . This tells us the dot product has to do with direction.
Specifically, when , the two vectors point in exactly the same direction. Not accounting for vector magnitudes, this is when the dot product is at its largest, because . In general, the more two vectors point in the same direction, the bigger the dot product between them will be.
When , the two vectors are precisely perpendicular to each other. This corresponds to the dot product between them being , because .
It's also possible for a dot product to be negative if the two vectors are pointing in opposite directions, which is when .
Another way to think about is to imagine one vector dropping a shadow on to the other. When the angle is small, the shadow lands far from the origin and the dot product is large.
When is close to , the shadow lands close to the origin and the dot product is small.
Keep in mind that the dot product of two vectors is a number, not a vector. That means, for example, that it doesn't make sense to ask what equals. Once we evaluated to be some number, we would end up trying to take the dot product between a number and a vector, which isn't how the dot product works.
A better way to compute the dot product
When we need to find a dot product in multivariable calculus, we typically have only the coordinates of and . Calculating would force us to find two square roots and a cosine, which is a lot of work! Luckily, there is an easier way. Just multiply corresponding components and then add:
Although the example above features 3D vectors, this formula extends for vectors of any length.
This makes calculating dot products straightforward if you know the components of each vector.
Let's try an example.
What is the dot product of and ?
Even though we now have a nice formula in terms of coordinates, the intuition behind the dot product remains how it measures relative direction. Try to predict the sign of the dot product based on just a picture.
Is the sign of the dot product between the two vectors positive, negative, or zero?
That's all we'll need to know about dot products for now. If you want to learn more, check out this video.
Now that we've covered the dot product, there's just one more vector operation to learn about: the cross product. As we'll see, the cross product nicely complements the dot product but is slightly more limited.
Want to join the conversation?
- why do we use dot products? what can it be used for, like in computers or something?(19 votes)
- It can also be used in physics; like the mathematical definition of "Work" is the dot product of force * displacement (change in position AKA distance)
If you're wondering about cross products too, then a good example is that torque is the cross product of the force vector and the displacement vector from the point at which the axis is (the center of rotation) and the point and which force is applied.
Hope this helps!(2 votes)
- Any further hint about the proof of why is the dot product the sum of the product of the components? Can't really crack this nut.(4 votes)
- Hi Michele, here's an idea.
Referring to the diagram in the hint, expand out each norm as v*v = v_1*v_1 + ... + v_n*v_n. Note that this follows from the Pythagorean theorem, so it is not circular logic! (Make sure to square everything to get rid of nasty square roots.) When you get to the norm ||a-b||^2, you will get many terms because (a-b)*(a-b) expands out linearly into four dot products. Some of these will cancel out however...
Now write out what the Law of Cosines tells you: ||b-a||^2 = ||a||^2 + ||b||^2 - 2*||a||*||b||*cos(theta). Using your simplified expansions for ||b-a||^2, ||a||^2, and ||b||^2, cancel any remaining terms and move everything else to one side of the equation. Divide by 2 to find a new expression for ||a||*||b||*cos(theta).
What do you find?(9 votes)
- Hello, everyone!
I get that dot products are scalars and thus have no direction, but are they just plain old numbers or do they have units? If they do, what kind of units do they have? If they don't, at what point in the process do they lose their units?
Thank you for any replies!(3 votes)
- The units for the dot product of two vectors is the product of the common unit used for all components of the first vector, and the common unit used for all components of the second vector.
For example, the dot product of a force vector with the common unit Newtons for all components, and a displacement vector with the common unit meters for all components, would have units Newton-meters.(4 votes)
- if the dot product is about how much two vector point in the same direction, why is the magnitude of the vectors a factor of the dot product? Shouldn't the angle between the two vectors be enough to decide whether they point in the similar direction or not. And when taking the dot product, how do you know whether to take the bigger angle or the smaller angle between the two vectors?(3 votes)