Skip to content

Angle Between Vectors

Theorem

For nonzero vectors x,y∈Rn\boldsymbol{x},\boldsymbol{y}\in\mathbb{R}^n, the angle θ\theta between them satisfies x⋅y=∥x∥∥y∥cos⁡θ\boldsymbol{x}\cdot \boldsymbol{y}=\|\boldsymbol{x}\|\|\boldsymbol{y}\|\cos\theta.


Interpretation

The angle formula turns the algebraic inner product into geometry. Dividing x⋅y\boldsymbol{x}\cdot \boldsymbol{y} by the Euclidean norms ∥x∥\|\boldsymbol{x}\| and ∥y∥\|\boldsymbol{y}\| removes the lengths and leaves only the information about direction, cos⁡θ\cos\theta.

The vectors x = (4, 1) and y = (1, 3) drawn from the origin with the angle theta between them.

For the vectors drawn, cos⁡θ=x⋅y∥x∥ ∥y∥=4+31710≈0.54\cos\theta=\dfrac{\boldsymbol{x}\cdot \boldsymbol{y}}{\|\boldsymbol{x}\|\,\|\boldsymbol{y}\|}=\dfrac{4+3}{\sqrt{17}\sqrt{10}}\approx0.54, so θ≈57.5∘\theta\approx57.5^\circ. Two nonzero vectors are perpendicular when their inner product is zero and parallel when their angle is 00 or 180∘180^\circ.

In R2\mathbb{R}^2 and R3\mathbb{R}^3 the formula follows from the law of cosines in the triangle with sides x\boldsymbol{x}, y\boldsymbol{y} and x−y\boldsymbol{x}-\boldsymbol{y}. In Rn\mathbb{R}^n with n>3n>3 there is no picture to measure in, and the formula is used to define θ∈[0,π]\theta\in[0,\pi] as the inverse cosine of the quotient. This definition makes sense because the Cauchy-Schwarz inequality guarantees that the quotient lies between −1-1 and 11.

Because of the normalization, changing the length of one vector does not change the angle: replacing x\boldsymbol{x} by 2x2\boldsymbol{x} doubles both x⋅y\boldsymbol{x}\cdot \boldsymbol{y} and ∥x∥\|\boldsymbol{x}\|. A negative multiple is different: replacing x\boldsymbol{x} by −x-\boldsymbol{x} changes the sign of cos⁡θ\cos\theta and turns θ\theta into π−θ\pi-\theta. Since the cosine is positive on [0,π/2)[0,\pi/2) and negative on (π/2,π](\pi/2,\pi], the sign of x⋅y\boldsymbol{x}\cdot \boldsymbol{y} alone tells acute from obtuse.

The formula needs nonzero vectors. For x=0\boldsymbol{x}=\boldsymbol{0} the quotient is undefined and no angle is assigned, although 0⋅y=0\boldsymbol{0}\cdot \boldsymbol{y}=0 makes the zero vector orthogonal to every vector.


Key Results

  • If x⋅y>0\boldsymbol{x}\cdot \boldsymbol{y}>0, the angle is acute.
  • If x⋅y=0\boldsymbol{x}\cdot \boldsymbol{y}=0, the angle is right and the vectors are orthogonal.

Examples

  • (1,0)(1,0) and (0,1)(0,1) have angle π/2\pi/2.
  • (1,0)(1,0) and (1,1)(1,1) have a positive inner product, so their angle is acute.

Prerequisites

Sources

Aliases: angle between two vectors Keywords: vector angle Symbols: element of, pi, real numbers, square root, theta

Last updated: 20 October 2026 03:02