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 vw\mathbf{v} - \mathbf{w} is the third side of the triangle formed by v\mathbf{v} and w\mathbf{w}. If v\mathbf{v} and w\mathbf{w} are at right angles, vw\mathbf{v} - \mathbf{w} is the hypotenuse of a right angle triangle.

Let us define v\mathbf{v} and w\mathbf{w} as two dimensional vectors:

v=[v1v2],w=[w1w2] \mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}, \quad \mathbf{w} = \begin{bmatrix} w_1 \\ w_2 \end{bmatrix}

Pythagoras’ theorem tells us that a2+b2=c2a^2 + b^2 = c^2 where aa and bb are the length perpendicular sides of a right angle triangle, and cc is the length of the hypotenuse. Plugging the information we know about subtracting v\mathbf{v} and w\mathbf{w} into Pythagoras’ theorem we get:

v2+w2=vw2||\mathbf{v}||^2 + ||\mathbf{w}||^2 = ||\mathbf{v} - \mathbf{w}||^2

If the v||\mathbf{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||\mathbf{v}|| = \sqrt{v_1^2 + v_2^2}.

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:

vw=[v1w1v2w2] \mathbf{v} - \mathbf{w} = \begin{bmatrix} v_1 - w_1 \\ v_2 - w_2 \end{bmatrix}

Putting this knowledge of subtracting vectors together with our knowledge of calculating vector lengths we can show that:

vw=(v1w1)2+(v2w2)2 ||\mathbf{v} - \mathbf{w}|| = \sqrt{(v_1 - w_1)^2 + (v_2 - w_2)^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.

v2+w2=vw2v12+v222+w12+w222=(v1w1)2+(v2w2)22v12+v22+w12+w22=(v1w1)2+(v2w2)2v12+v22+w12+w22=(v1w1)(v1w1)+(v2w2)(v2w2)v12+v22+w12+w22=v12v1w1v1w1+w12+v22v2w2v2w2+w22v12+v22+w12+w22=v122v1w1+w12+v222v2w2+w220=2v1w12v2w2v1w1+v2w2=0 \begin{aligned} ||\mathbf{v}||^2 + ||\mathbf{w}||^2 &= ||\mathbf{v} - \mathbf{w}||^2 \\ \sqrt{v_1^2 + v_2^2}^2 + \sqrt{w_1^2 + w_2^2}^2 &= \sqrt{(v_1 - w_1)^2 + (v_2 - w_2)^2}^2 \\ v_1^2 + v_2^2 + w_1^2 + w_2^2 &= (v_1 - w_1)^2 + (v_2 - w_2)^2 \\ v_1^2 + v_2^2 + w_1^2 + w_2^2 &= (v_1 - w_1)(v_1 - w_1) + (v_2 - w_2)(v_2 - w_2) \\ v_1^2 + v_2^2 + w_1^2 + w_2^2 &= v_1^2 - v_1 w_1 - v_1 w_1 + w_1^2 + v_2^2 - v_2 w_2 - v_2 w_2 + w_2^2 \\ v_1^2 + v_2^2 + w_1^2 + w_2^2 &= v_1^2 - 2 v_1 w_1 + w_1^2 + v_2^2 - 2 v_2 w_2 + w_2^2 \\ 0 &= - 2 v_1 w_1 - 2 v_2 w_2 \\ v_1 w_1 + v_2 w_2 &= 0 \end{aligned}

So what we have proven so far is that when v\mathbf{v} and w\mathbf{w} are perpendicular, then v1w1+v2w2=0v_1 w_1 + v_2 w_2 = 0. The original assertion was two perpendicular vectors have a dot product of zero. Let us calculate the dot product of v\mathbf{v} and w\mathbf{w} and see what we get. If you need a refresher on dot products look here.

vw=[v1v2][w1w2]=v1w1+v2w2 \mathbf{v} \cdot \mathbf{w} = \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} \cdot \begin{bmatrix} w_1 \\ w_2 \end{bmatrix} = v_1 w_1 + v_2 w_2

So we have shown that the dot product of v\mathbf{v} and w\mathbf{w} is zero when v\mathbf{v} and w\mathbf{w} are perpendicular.

Subscribe to 15 Minute Finance

Be the first to know when new posts are published

Buy me a coffee

If you have learnt something today, please consider supporting me