In this video we're going to define and describe a new operation on vectors. We're going to talk about the dot product, or the scalar product as it's sometimes known. It works like this.
If u and v are both vectors... Then u dot v, the dot product of u and v, is a scalar. And in order to define it, we're going to need the angle between u and v. So we draw them in a diagram, have u like this and v like this, and we'll call the angle between u and v theta.
Now using that, we define u dot v to be equal to the magnitude of u times the magnitude of v times the cosine of theta, the angle between u and v. That's how we define the dot product. I tend to think of the dot product as being some measure of the way that two vectors pull in the same direction. I'll do some examples to see why I think that.
So the first example I'll do will be of two different basis vectors. So remember from the last video we had basis vectors i, j and k. I'll look at j, which was a unit vector pointing right.
and k, which was a unit vector pointing up on the board. Now what happens if we take j dot k, the dot product of the two vectors, j with k? Now, by definition of the dot product, that's equal to the magnitude of j times the magnitude of k times the cosine of the angle between them.
But J and K are unit vectors, so their magnitude is 1. So this is 1 times 1. times the cosine of the angle between them. Let's see. The angle between them is 90 degrees, and that has cosine equal to 0. So their dot product turns out to be 0. So that supports my feeling that the dot product tells us how two vectors pull together, because j and k are at right angles to each other.
They pull in no sense together. For another example, let's take a vector and dot it with itself. So if we have some vector v, like that, then...
v dot v, the dot product of v with itself, is equal to mod v, magnitude of v that is, times magnitude of v, again, times the cosine of the angle between v and v, because since v and v point in the same direction, the angle between them is zero. So that gives us two copies of... The magnitude of v, multiplying together, so that's the magnitude of v squared, times cos 0. But of course the cosine of 0 is just 1. So the dot product of v with v is just the magnitude of v squared.
This will turn out to be helpful later, because it's a good way of getting our hands on the magnitude of v, to take the dot product of v with itself, and then take the square root. For yet another example, what if we dot v with minus v? So remember minus v is this vector that is about the same size as v. It would be the same size if I could draw it well.
And it points in the opposite direction. So minus v is like v, except it points in exactly the opposite direction. Now if we take v dot minus v. That's equal to the modulus of v times the modulus of minus v times...
the cosine of the angle between them. But let's see. The magnitude of v is whatever it is.
The magnitude of minus v is the same as the magnitude of v. Because they have the same magnitude, they just point in opposite directions. And then there's the cosine of theta. What is the angle between v and minus v? Well, in order to get from v to minus v, you have to turn full way around, which is 180 degrees. So what we get is the magnitude of v squared times the cosine of 180 degrees.
But the cosine of 180 degrees is minus 1. The final answer is. that the dot product of v with minus v is minus the magnitude of v squared. And again, these two results support my feeling that the dot product measures how well things pull together. So if we take the dot product of v with v, we just get something to do with how big v is. But if we take the dot product of v with minus v, they pull against each other, so we get something negative. We should notice while we're at it that this result here, that j dot k is 0, that'll work for any two parallel vectors, any two perpendicular vectors, sorry.
So any time we have vectors with a 90 degree angle between them, such as these two, the cosine of 90 degrees is 0, so the dot product will end up being 0. Since we have coordinates now, we might wonder how to compute a dot product in coordinates. So let's say we have two vectors u, which we could say is ai plus bj plus ck, and another vector v, which we could say is xi plus yj plus zk. So there's two vectors, u and v, and we've written both out in coordinates. So the coordinates of the first one are a, b, and c. The coordinates of the second are x, y, and z.
We might wonder how we take the dot products of these two vectors. And there's a rule for doing it, and the rule is this. We have u dot v equal to ax. plus by plus cz. So the rule says that when we have two vectors written in coordinates and we want to work out their dot product, what we do is we multiply together corresponding coordinates.
So we multiply together the i coordinates a and x. We multiply together the the j coordinates b and y, and we multiply together the k coordinates c and z. And then we, having multiplied them all together, we just add up those three things, and that's the dot product.
This is very helpful for calculating. It's much, much easier than having to calculate cosines a lot of the time. So in particular for an example if we had 2i minus j plus 3k and we wanted to take the dot product of that with 4i plus 2j minus k Well, then that's equal to what we get by multiplying the two i coordinates, so that's 2 times 4, plus what we get by multiplying the two j coordinates, so that's minus 1 times 2, plus what we get by multiplying the two k coordinates, so that's 3 times minus 1. So that's equal to 8. minus 2, minus 3, and that's of course equal to 3. So in this case, we have a vector in coordinates.
We can work out the dot product very easily just by this rule.