Linear algebra part 6 - Dot product of perpendicular vectors
I am going to start this post with an assertion: If two vectors are at right
angles to each other, their dot product will be zero. Think back to the first two
posts on adding and subtracting vectors and plotting vectors.
We know that if you subtract two vectors the resulting vector has the same length
as a line drawn from the tip of one vector to the tip of the other. In other words
v−w is the third side of the triangle formed
by v and w. If v
and w are at right angles, v−w
is the hypotenuse of a right angle triangle.
Let us define v and w as two
dimensional vectors:
v=[v1v2],w=[w1w2]
Pythagoras’ theorem tells us that a2+b2=c2 where a
and b are the length perpendicular sides of a right angle triangle,
and c is the length of the hypotenuse. Plugging the information we
know about subtracting v and w
into Pythagoras’ theorem we get:
∣∣v∣∣2+∣∣w∣∣2=∣∣v−w∣∣2
If the ∣∣v∣∣ notation does not mean anything to you,
review the last post on the length of vectors. In that
post we learnt that ∣∣v∣∣=v12+v22.
The other bit of knowlege we need to recall from a previous post is
how to subtract vectors. In that post we showed that you
subtract vectors by subtracting the individual elements of the vectors:
v−w=[v1−w1v2−w2]
Putting this knowledge of subtracting vectors together with our knowledge of
calculating vector lengths we can show that:
∣∣v−w∣∣=(v1−w1)2+(v2−w2)2
Now let us plug all of this back into our version of Pythagoras’ equation and do
and whole bunch of expanding and simplifying. Work through this yourself and make
sure you are convinced it is correct.
So what we have proven so far is that when v and
w are perpendicular, then v1w1+v2w2=0.
The original assertion was two perpendicular vectors have a dot product of zero.
Let us calculate the dot product of v and w
and see what we get. If you need a refresher on dot products look here.
v⋅w=[v1v2]⋅[w1w2]=v1w1+v2w2
So we have shown that the dot product of v and
w is zero when v and
w are perpendicular.