6.2 Length

Another important usage of the inner product is that it allows us to define the length of a vector \(\mathbf{x}\), denoted by \(\| \mathbf{x} \|\), as the square root of the inner product of the vector with itself::

\[ \| \mathbf{x} \| = \sqrt{\mathbf{x^\mathsf{T} x}} \]

which is typically known as the norm of a vector.

We can calculate the length of the vector weight as:

\[ \| \texttt{weight} \| = \sqrt{(150 \times 150) + (172 \times 172)} = 228.2192 \]

Likewise, the length of the vector height is:

\[ \| \texttt{height} \| = \sqrt{(49 \times 49) + (77 \times 77)} = 91.2688 \]

Note that the inner product of a vector with itself is equal to its squared norm:

\[ \mathbf{x^\mathsf{T} x} = \| \mathbf{x} \|^2 \]