The dot product v⋅w is the number v1w1+⋯+vnwn .
09. Dot product, 1
09. Dot product, 1
Dot product
Given two vectors v=(v1⋮vn) and w=(w1⋮wn) 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 compute that angle, we introduce the dot product v⋅w .
If θ is the angle between v and w then v⋅w=|v||w|cosθ.
We will prove this in due course, but first we'll explore it a little.
Let v=(10) and w=(01) . We have v⋅w=1×0+0×1=0 .

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).

Let's confirm this: we have v⋅w=1×1+0×1=1 . We also have |v|=√1+1=√2 by Pythagoras and |w|=1 , so 1=v⋅w=|v||w|cosθ=√2cosθ,
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).
