Now, there's one last thing to talk about in the segment which is called projection.

Projection. And for that,

we'll need to draw a triangle.

So if I've got a vector r and another vector s. Now,

if I take a little right-handed triangle,

drop a little right-handed triangle down here where this angle's 90 degrees,

then I can do the following.

If I can say that, if this angle here is theta,

but cos theta is equal to, from SOHCAHTOA,

is equal to the adjacent length here over the hypotenuse there. Adjacent over the hypotenuse.

That is, and this hypotenuse is the size of s, so it's the adjacent over the size of s, there.

Now, if I compare that to the definition of the dot product,

I can say that r dotted with,

we'll have fun with colors,

dotted with s is equal

to mod r, size of r,

times the size of s, times cos theta.

But the size of s times cos theta if I put s up here,

I just need to put my theta in there,

s cos theta is just the adjacent side,

so that's just that adjacent side here in the triangle.

So, the adjacent side here is just kind of the shadow,

if I had a light coming down from here,

it's the shadow of s on r. That length there,

it's kind of a shadow cast.

If I had a light at 90 degrees to r shining down on s,

and that's called the projection.

So what the dot product gives us,

is it gives us the projection here of s on to r times the size of r.

And one thing to notice here is that if s was perpendicular to r,

if s was pointing this way,

it would have no shadow.

That is if cos theta was 90 degrees that shadow would be nought,

the cos theta would be nought here and I get no projection.

So, the other thing the dot product gives us,

is it gives us the size of r times some idea about

the projection of s on to r. The shadow of s onto r. So,

if I divide the dot product r.s by the length of r,

just bring the r down here,

I get mod s cos theta.

I get that adjacent side,

I get a number which is called,

because r.s is a number, and the size of r is a number,

and that's called the scalar projection.

And that's why the dot product is also called the projection product,

because it takes the projection of one vector onto another.

We just have to divide by the length of r,

and if r happened to be a unit vector or one of

the vectors we used to find the space, of length one,

then that would be of length one and r dot s would just be the scalar projection of

s onto that r, that vector defining the axes or whatever it was.

Now, if I want to remember to encode something about r,

which way r was going into the dot product or into the projection product

I could define something called the vector projection.

And that's defined to be r.s over mod r dotted with itself.

So r.r mod r squared,

that's r.s over r.r if you like because mod r squared is equal to r.r.

And we multiply that by the vector r itself.

So that is, that dot product's just a number,

these sizes are just a number,

and r itself is a vector.

So what we've done here is we've taken the scalar projection r.s over r,

this guy, that's how much s goes along r,

and we've multiplied it by r divided by its length.

So we've multiplied it by a vector going the direction

of r but it's been normalized to have a length one.

So that vector projection is a number,

times a unit vector that goes in the direction

of r. So if r say was some number of lengths,

that would be r divided by its size,

say if that was a unit length vector I've just drawn there,

and the vector projection would be that number s.r, that adjacent side,

times a vector going in the unit length of r. So that's,

if you like the scalar projection also encoded with something about the direction of r,

just a unit vector going in the direction of r.

So we've defined a scalar projection here,

and we've defined a vector projection there.

So, good job! This was really the core video for this week,

we've done some real work here.

We found the size of a vector and we defined the dot projection product.

We've then found out some mathematical operations we can do with the dot product.

That it's distributive over vector addition and

associative with scalar multiplication and that it's commutative.

We then found that it finds the angle between two vectors,

the extent to which they go in the same direction,

and then it finds the projection of one vector onto another.

That's kind of how one vector will collapse onto another,

which is what we'll explore in the next two videos.

So, good work, now's a good time to pause,

and try some examples,

but put all this together and give it all a workout and a bit of a try before we move on.