09. Dot product, 1

09. Dot product, 1

Dot product

Given two vectors v=(v1vn) and w=(w1wn) in 𝐑n , what is the angle between them?

To define angles in 𝐑n , note that the two vectors v and w are contained in a unique 2-plane, and we mean the usual angle between v and w inside that plane.

To measure the angle between vectors in 3D, look inside the unique plane containing them and use the usual definition of angle

To compute that angle, we introduce the dot product vw .

Definition:

The dot product vw is the number v1w1++vnwn .

Theorem:

If θ is the angle between v and w then vw=|v||w|cosθ.

Recall that |v| means the length of v .

We will prove this in due course, but first we'll explore it a little.

Let v=(10) and w=(01) . We have vw=1×0+0×1=0 .

The vectors v=(1,0) and w=(0,1) (at right angles)

This makes sense: the angle between v and w is π/2 radians, and cos(π/2)=0 . In this case, we say the vectors are orthogonal to one another (equivalent to "perpendicular" or "at right angles").

Let v=(11) and w=(10) . We can see the angle between them should be 45 degrees (π/4 radians).

The vectors v=(1,1) and w=(1,0) (at 45 degrees)

Let's confirm this: we have vw=1×1+0×1=1 . We also have |v|=1+1=2 by Pythagoras and |w|=1 , so 1=vw=|v||w|cosθ=2cosθ,

so cosθ should be 1/2 . Indeed, cos(π/4)=1/2 .

Even if you didn't know the angle, you could figure it out as arccos(1/2) . You might object that arccos is multivalued, for example cos(π/4)=cos(3π/4) . This just corresponds to the fact that there are different ways of picking "the" angle between v and w (e.g. clockwise or anticlockwise).

Two lines which meet at 45 degrees could also be thought of as meeting at 135 degrees