Skip to main content

The dot product in space: lengths, angles, and perpendicularity

2026-10-22 huynhvietkhanh Comments: 0

Calculate dot products, sum and difference lengths, and perpendicular directions while treating zero vectors separately.

High schoolSolid Geometry & Vectors

Content updated: October 22, 2026

The dot product of two vectors is a real number. It relates lengths to angles and turns perpendicularity into an equation. Distinguish it from the cross product, whose result is a vector.

Learning goals: calculate dot products and lengths of sums and differences, apply perpendicularity correctly, and handle the zero vector.

Prerequisites: angles between nonzero vectors, vector lengths, and vector addition.

1. Definition and the zero-vector case

For $\vec u,\vec v\ne\vec0$ with angle $\theta$, define

$$\vec u\cdot\vec v=\|\vec u\|\,\|\vec v\|\cos\theta.$$

If either vector is zero, their dot product is $0$; this rule is stated separately because the angle with $\vec0$ is undefined. If both are nonzero, the product is positive for $0^\circ\le\theta<90^\circ$, equal to $0$ for $\theta=90^\circ$, and negative for $90^\circ<\theta\le180^\circ$. Thus the same-direction and opposite-direction cases are included.

Dot product and the angle between vectorsNonzero vectors u and v share an initial point. Their dot product equals the product of their lengths and cosine theta.u · v = ‖u‖ ‖v‖ cos θθuv
New schematic: the dot product and the angle between two nonzero vectors.

In orthogonal Cartesian coordinates, for $\vec u=(u_1;u_2;u_3)$ and $\vec v=(v_1;v_2;v_3)$, we have $\vec u\cdot\vec v=u_1v_1+u_2v_2+u_3v_3$. The coordinate formula also applies when a vector is zero.

2. Lengths and identities

The dot product is commutative, distributive over addition, and compatible with scalar multiplication. In particular, $\vec a\cdot\vec a=\|\vec a\|^2$ for every vector. If $\vec a\ne\vec0$, its angle with itself is $0^\circ$; if $\vec a=\vec0$, both sides equal $0$ without requiring an angle.

Distributivity implies

$$\begin{aligned}\|\vec a+\vec b\|^2&=\|\vec a\|^2+2\vec a\cdot\vec b+\|\vec b\|^2,\\\|\vec a-\vec b\|^2&=\|\vec a\|^2-2\vec a\cdot\vec b+\|\vec b\|^2.\end{aligned}$$

After calculating a squared length, take the nonnegative square root to obtain the length. Knowing only the two lengths, without an angle or dot product, generally does not determine the length of their sum uniquely.

For lines with direction vectors $\vec u,\vec v\ne\vec0$, perpendicularity is equivalent to $\vec u\cdot\vec v=0$. A dot product equal to $0$ for arbitrary vectors does not permit a zero vector to serve as a direction vector. When dividing by lengths in an angle formula, both denominators must differ from $0$.

3. Worked examples

Example 1. An angle of 60 degrees

Let $\|\vec u\|=a>0$ and $\|\vec v\|=b>0$, with angle $60^\circ$ between the vectors. Then $\vec u\cdot\vec v=ab\cos60^\circ=ab/2$. This multiplies two lengths by a number, producing a real number, not a vector.

Example 2. The length of a sum depends on the angle

Let $\|\vec a\|=3$ and $\|\vec b\|=5$. If their angle is $30^\circ$, then $\vec a\cdot\vec b=15\sqrt3/2$. Hence

$$\|\vec a+\vec b\|^2=9+15\sqrt3+25=34+15\sqrt3,$$

and $\|\vec a+\vec b\|=\sqrt{34+15\sqrt3}$. The assumed angle $30^\circ$ is needed for this calculation. If the vectors point in the same direction, the sum has length $8$; if they point in opposite directions, it has length $2$, although the individual lengths remain $3,5$.

The sum length depends on the vector angleVectors a and b have lengths 3 and 5 and angle 30 degrees. The red diagonal represents their sum. Its squared length is 34 plus 15 times square root of 3.‖a‖ = 3, ‖b‖ = 5, θ = 30°aba + b30°The angle is part of the data.
New schematic: the sum length requires the vector lengths and their angle.

Example 3. Test perpendicularity in coordinates

For $\vec u=(1;2;-2)$ and $\vec v=(2;-1;0)$, we have $\vec u\cdot\vec v=2-2+0=0$. Both vectors are nonzero, so they are perpendicular. Also, $\|\vec u\|^2=9$ and $\|\vec v\|^2=5$, so $\|\vec u+\vec v\|=\sqrt{14}$. Directly calculating the length of the sum $(3;1;-2)$ confirms the result.

4. Practice

  1. Let $\vec u=(2;-1;2)$ and $\vec v=(1;2;2)$. Calculate their dot product and the lengths of their sum and difference.
  2. Find $m$ such that $\vec u=(m;1;2)$ and $\vec v=(1;2;-1)$ are perpendicular.
  3. Given $\|\vec a\|=2$ and $\|\vec b\|=3$, with angle $120^\circ$ between the vectors, calculate $\vec a\cdot\vec b$ and $\|\vec a+\vec b\|$.
Hints and answers
  1. The dot product is $4$, and both individual squared lengths are $9$. Hence the sum has length $\sqrt{26}$, and the difference has length $\sqrt{10}$.
  2. Both vectors are always nonzero, and their dot product is $m+2-2=m$. Thus $m=0$.
  3. The dot product is
    $$2\cdot3\cos120^\circ=-3.$$

    The squared length of the sum is

    $$4-6+9=7.$$

    Thus the length is $\sqrt7$.

5. Common mistakes

Do not write an angle as the zero vector or confuse a length with its square. To prove perpendicularity of lines, choose two valid nonzero direction vectors; do not use the dot product $0$ of the zero vector with every vector.

6. Further study and sources

Vector angles and line angles in space (English lesson) · The coordinate formula for the dot product (English lesson) · Perpendicular lines (English lesson) · Calculating the angle between lines in space (English lesson).

Original resource on Scribd (external link).

Leave a Reply

Your email address will not be published. Required fields are marked *