The length - sometimes called norm - of a vector v, denoted
by the symbol ∥v∥, can be computed
by using the
dot product
operation.
We remind ourselves of the pythagorean theorem
a2+b2=c2,
which allows us to compute the length of the hypotenuse c of a
right-angled triangle in terms of its catheti (the other two sides).
This applies well to our use-case. For simplicity, I will stick
to two dimensions for now.
We consider the following vector v:
v=[v1v2].
We can think of ∥v∥ as the hypotenuse of a right-angled triangle.
Its components - in this case v1 and v2 respectively - form the two catheti:
According to the pythagorean theorem, the length of the vector would
be given by
∥v∥=v12+v22.
The same idea applies to vectors with more dimensions.
But how can we generalize this? We can write this by using the dot product.
We take the dot product of the vector v with itself and take
the square root of the result:
∥v∥=v⋅v.
If we expand this, we see that we get exactly the pythagorean theorem: