From Inner Products to Angles
In Euclidean geometry, an angle describes how two directions relate. An inner product gives a way to express that relationship even when vectors are not presented as arrows in the plane. The key quantity is the inner product divided by the lengths of both vectors: this normalized value measures their alignment without depending on their sizes. The real Cauchy–Schwarz inequality ensures that it is always a number from \(-1\) to \(1\), so it can be the cosine of a unique angle.
Throughout, \(V\) is a vector space over \(\mathbb{R}\) with a real inner product \(\langle\cdot,\cdot\rangle\). Such an inner product is symmetric and bilinear, and it satisfies \(\langle\mathbf{x},\mathbf{x}\rangle>0\) whenever \(\mathbf{x}\ne\mathbf{0}\). Its induced norm is \(\|\mathbf{x}\|=\sqrt{\langle\mathbf{x},\mathbf{x}\rangle}\). In particular, \(\|\mathbf{x}\|>0\) for every nonzero vector. We use radians, so angles lie between \(0\) and \(\pi\), inclusive.
The condition that both vectors be nonzero matters: if either vector is zero, the denominator vanishes, and this definition does not assign an angle. The Real Cauchy–Schwarz Inequality, established earlier, states that \(|\langle\mathbf{u},\mathbf{v}\rangle|\leq\|\mathbf{u}\|\,\|\mathbf{v}\|\) for vectors in a real inner product space. Dividing by the positive product of the norms places the normalized inner product in \([-1,1]\). Since cosine takes each value in this interval exactly once on \([0,\pi]\), the definition gives one and only one angle.
Proof. Since \(\mathbf{u}\) and \(\mathbf{v}\) are nonzero, positive definiteness gives \(\|\mathbf{u}\|\,\|\mathbf{v}\|>0\). The Real Cauchy–Schwarz Inequality applies to these vectors and gives \(|\langle\mathbf{u},\mathbf{v}\rangle|\leq\|\mathbf{u}\|\,\|\mathbf{v}\|\). Dividing by the positive denominator shows that \(-1\leq\langle\mathbf{u},\mathbf{v}\rangle/(\|\mathbf{u}\|\,\|\mathbf{v}\|)\leq1\). Thus the inverse cosine is defined and produces an angle in \([0,\pi]\). The cosine function is one-to-one on this interval, so no other angle in the interval can have the same cosine. \(\square\)
Calculating Angles in Coordinate Spaces
In \(\mathbb{R}^n\) with the standard inner product, \(\langle\mathbf{u},\mathbf{v}\rangle=\mathbf{u}^{\top}\mathbf{v}\). The calculation has three parts: find the inner product, find both norms, and divide by their product. Keep the normalization in the formula; the inner product by itself is generally not the cosine.
Worked Example: An Angle of \(\pi/3\) in \(\mathbb{R}^2\)
Let \(\mathbf{u}=(1,0)^{\top}\) and \(\mathbf{v}=(1,\sqrt{3})^{\top}\), using the standard inner product. Find the angle between them.
First calculate the inner product and norms:
The normalized inner product is \(1/(1\cdot2)=1/2\), so the angle is \(\arccos(1/2)=\pi/3\).
Check: \(\cos(\pi/3)=1/2\), which equals \(\langle\mathbf{u},\mathbf{v}\rangle/(\|\mathbf{u}\|\,\|\mathbf{v}\|)\). Both vectors are nonzero, as required.
The same definition works with other real inner products. The inner product determines the norms too, so changing the inner product can change the angle even when the coordinates stay fixed. For instance, on \(\mathbb{R}^2\) the formula \(\langle\mathbf{x},\mathbf{y}\rangle=2x_1y_1+x_2y_2\) is a real inner product: it is symmetric and bilinear, and \(\langle\mathbf{x},\mathbf{x}\rangle=2x_1^2+x_2^2>0\) whenever \(\mathbf{x}\ne\mathbf{0}\).
Worked Example: An Angle with a Weighted Inner Product
Use the inner product \(\langle\mathbf{x},\mathbf{y}\rangle=2x_1y_1+x_2y_2\) and the vectors \(\mathbf{u}=(1,0)^{\top}\), \(\mathbf{v}=(1,1)^{\top}\). Find their angle.
The inner product and squared norms are \(\langle\mathbf{u},\mathbf{v}\rangle=2(1)(1)+(0)(1)=2\), \(\|\mathbf{u}\|^2=2(1)^2+(0)^2=2\), and \(\|\mathbf{v}\|^2=2(1)^2+(1)^2=3\). Therefore, \(\|\mathbf{u}\|=\sqrt{2}\) and \(\|\mathbf{v}\|=\sqrt{3}\). The normalized inner product is
Thus the angle is \(\arccos\!\bigl(\sqrt{2/3}\bigr)\).
Check: The cosine of this angle is \(\sqrt{2/3}\), and the direct inner-product calculation gives the same value. In particular, using the standard dot product on these coordinates would give a different normalized value; the inner product specified in the question must be used for both the numerator and the norms.
How Angles Behave Under Scaling
The normalized inner product also explains how rescaling vectors affects their angle. Multiplying a vector by a positive scalar changes its length but not its direction. Multiplying by a negative scalar reverses its direction, which replaces an angle by its supplement.
Proof. Symmetry of the real inner product gives \(\langle\mathbf{v},\mathbf{u}\rangle=\langle\mathbf{u},\mathbf{v}\rangle\), and the product \(\|\mathbf{u}\|\,\|\mathbf{v}\|\) is unchanged when its factors are interchanged. The normalized inner product, and therefore its inverse cosine, is unchanged. For scaling, bilinearity gives \(\langle a\mathbf{u},b\mathbf{v}\rangle=ab\langle\mathbf{u},\mathbf{v}\rangle\), while the induced norm satisfies \(\|a\mathbf{u}\|=|a|\|\mathbf{u}\|\) and \(\|b\mathbf{v}\|=|b|\|\mathbf{v}\|\). The normalized inner product of the scaled vectors is consequently \[ \frac{ab}{|a||b|}\, \frac{\langle\mathbf{u},\mathbf{v}\rangle}{\|\mathbf{u}\|\,\|\mathbf{v}\|}. \] The factor \(ab/(|a||b|)\) is \(1\) when \(ab>0\) and \(-1\) when \(ab<0\). In the first case the angle is \(\theta\). In the second case the cosine is \(-\cos\theta\), which equals \(\cos(\pi-\theta)\). Since both angles are in \([0,\pi]\), uniqueness from the well-defined angle theorem gives \(\pi-\theta\). \(\square\)
An angle can also be read from the lengths in the triangle formed by \(\mathbf{0}\), \(\mathbf{u}\), and \(\mathbf{v}\). The vector from \(\mathbf{u}\) to \(\mathbf{v}\) is \(\mathbf{v}-\mathbf{u}\). Expanding its squared norm gives the inner-product version of the cosine law.
Proof. Bilinearity and symmetry give \(\|\mathbf{u}-\mathbf{v}\|^2=\langle\mathbf{u}-\mathbf{v},\mathbf{u}-\mathbf{v}\rangle=\|\mathbf{u}\|^2+\|\mathbf{v}\|^2-2\langle\mathbf{u},\mathbf{v}\rangle\). By the definition of \(\theta\), \(\langle\mathbf{u},\mathbf{v}\rangle=\|\mathbf{u}\|\,\|\mathbf{v}\|\cos\theta\). Substitution gives the stated formula. \(\square\)
Worked Example: An Angle Between Polynomials
Consider the real polynomials \(p(x)=1\) and \(q(x)=1+x\) with inner product \(\langle f,g\rangle=\int_{-1}^{1}f(x)g(x)\,dx\). Find their angle.
The inner product is
For the norms, first compute each squared norm: \(\|p\|^2=\int_{-1}^{1}1\,dx=2\), and \(\|q\|^2=\int_{-1}^{1}(1+x)^2\,dx\). Expanding and integrating gives
Hence \(\|p\|=\sqrt{2}\), \(\|q\|=\sqrt{8/3}\), and their product is \(\sqrt{16/3}=4/\sqrt{3}\). The normalized inner product is \(2/(4/\sqrt{3})=\sqrt{3}/2\), so the angle is \(\arccos(\sqrt{3}/2)=\pi/6\).
Check: \(\cos(\pi/6)=\sqrt{3}/2\), matching the normalized inner product. Neither polynomial is zero, so both norms in the denominator are positive.
Common Mistakes and a Reliable Check
Mistake: treating the inner product itself as the cosine. For example, in standard \(\mathbb{R}^2\), take \(\mathbf{u}=(1,1)^{\top}\) and \(\mathbf{v}=(1,0)^{\top}\). A wrong calculation sets \(\cos\theta=\langle\mathbf{u},\mathbf{v}\rangle=1\), and concludes \(\theta=0\). But the vectors are not in the same direction. The correction is to divide by both norms: \(\|\mathbf{u}\|=\sqrt{2}\), \(\|\mathbf{v}\|=1\), and \(\langle\mathbf{u},\mathbf{v}\rangle=1\). Thus \(\cos\theta=1/\sqrt{2}\) and \(\theta=\pi/4\). Substitution checks the answer because \(\cos(\pi/4)=1/\sqrt{2}\).
A second error is applying the formula when one vector is zero. If \(\mathbf{u}=\mathbf{0}\), then \(\|\mathbf{u}\|\,\|\mathbf{v}\|=0\), so the normalized inner product is undefined. The angle definition therefore does not apply; do not assign an angle by dividing by zero or by treating the zero vector as a direction.
For any valid calculation, check that both vectors are nonzero, that the correct inner product is used in the numerator and in each norm, and that the normalized result lies in \([-1,1]\). Then confirm that taking the cosine of the proposed angle recovers that result. This last check catches many arithmetic and inverse-cosine errors.
Check Your Understanding
Use the definition of angle and show the inner product and both norms in each calculation.
- In standard \(\mathbb{R}^2\), find the angle between \((1,0)^{\top}\) and \((1,1)^{\top}\).
- For the weighted inner product \(\langle\mathbf{x},\mathbf{y}\rangle=3x_1y_1+x_2y_2\), find the normalized inner product of \((1,0)^{\top}\) and \((1,1)^{\top}\).
- Explain why the angle definition does not apply to a pair that includes the zero vector.
- If the angle between \(\mathbf{u}\) and \(\mathbf{v}\) is \(\theta\), what is the angle between \(-\mathbf{u}\) and \(\mathbf{v}\)?
- Starting from bilinearity and symmetry, derive the inner-product cosine law for \(\|\mathbf{u}-\mathbf{v}\|^2\).