01 / 21

The Dot Product
Angles & Projections

Discover how the dot product connects algebra and geometry: compute angles between vectors, test for orthogonality, and find scalar projections.

Multivariable Calculus

What Is the Dot Product?

The dot product (also called the scalar product) takes two vectors and returns a single number: not a vector. Given \(\mathbf{a} = \langle a_1, a_2, a_3 \rangle\) and \(\mathbf{b} = \langle b_1, b_2, b_3 \rangle\), the algebraic definition is:

Multiply corresponding components, then add the products. The result is a scalar (a real number), which encodes deep geometric information about the two vectors.

The Geometric Meaning

\(\mathbf{a}\)
\(\mathbf{b}\)
\(\theta\)

Why the Dot Product Matters

Angle Finding
Compute the exact angle between any two vectors in 2D or 3D space.
Orthogonality Test
Two vectors are perpendicular if and only if \(\mathbf{a}\cdot\mathbf{b}=0\).
Projections
Decompose one vector along the direction of another: key for physics and engineering.

From computing work in physics (\(W = \mathbf{F}\cdot\mathbf{d}\)) to lighting in computer graphics, the dot product is everywhere.

Finding the Angle Between Vectors

1
Compute \(\mathbf{a}\cdot\mathbf{b}\) using component multiplication.
2
Compute \(\|\mathbf{a}\|\) and \(\|\mathbf{b}\|\) as magnitudes.
3
Divide and take \(\cos^{-1}\) to get \(\theta\) in \([0, \pi]\).

Orthogonal Vectors

\(\mathbf{a}\)
\(\mathbf{b}\)
\(90^\circ\)

The Sign Tells Direction

\(\mathbf{a}\cdot\mathbf{b} > 0\)
Angle \(\theta < 90^\circ\): vectors point in similar directions (acute).
\(\mathbf{a}\cdot\mathbf{b} = 0\)
Angle \(\theta = 90^\circ\): vectors are perpendicular (orthogonal).
\(\mathbf{a}\cdot\mathbf{b} < 0\)
Angle \(\theta > 90^\circ\): vectors point in opposing directions (obtuse).

Scalar Projection

\(\mathbf{a}\)
\(\mathbf{b}\)
\(\text{comp}_{\mathbf{a}}\,\mathbf{b}\)
\(\theta\)

Vector Projection

The scalar projection gives you the length. The vector projection gives you the actual vector along \(\mathbf{a}\). Multiply the scalar projection by the unit vector \(\hat{\mathbf{a}}\).

Dot Product vs Cross Product

Dot Product \(\mathbf{a}\cdot\mathbf{b}\) Cross Product \(\mathbf{a}\times\mathbf{b}\)
Result Type Scalar (number) Vector
Formula (geometric) \(\|\mathbf{a}\|\|\mathbf{b}\|\cos\theta\) \(\|\mathbf{a}\|\|\mathbf{b}\|\sin\theta\,\hat{\mathbf{n}}\)
Measures How aligned vectors are How perpendicular vectors are
Zero when Perpendicular (\(\theta=90^\circ\)) Parallel (\(\theta=0^\circ\) or \(180^\circ\))
Works in Any dimension 3D only

Step-by-Step Method

1
Identify the two vectors \(\mathbf{a}\) and \(\mathbf{b}\) and what you need to find (angle, projection, or orthogonality check).
2
Compute \(\mathbf{a}\cdot\mathbf{b} = a_1b_1 + a_2b_2 + a_3b_3\).
3
Compute magnitudes \(\|\mathbf{a}\| = \sqrt{a_1^2+a_2^2+a_3^2}\) and \(\|\mathbf{b}\|\).
4
For angle: \(\theta = \cos^{-1}\!\left(\frac{\mathbf{a}\cdot\mathbf{b}}{\|\mathbf{a}\|\|\mathbf{b}\|}\right)\). For projection: \(\text{proj}_\mathbf{a}\mathbf{b} = \frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{a}\cdot\mathbf{a}}\,\mathbf{a}\).
5
Verify: check the sign matches your geometric expectation (acute/obtuse/perpendicular).

Example 1: Finding the Angle

Find the angle between \(\mathbf{a}=\langle 1,2,3\rangle\) and \(\mathbf{b}=\langle 4,-5,6\rangle\).

1
Dot product: \(\mathbf{a}\cdot\mathbf{b} = (1)(4)+(2)(-5)+(3)(6) = 4-10+18 =\) 12
2
Magnitudes: \(\|\mathbf{a}\|=\sqrt{1+4+9}=\sqrt{14}\), \(\|\mathbf{b}\|=\sqrt{16+25+36}=\sqrt{77}\)
3
Angle: \(\cos\theta = \frac{12}{\sqrt{14}\cdot\sqrt{77}} = \frac{12}{\sqrt{1078}} \approx 0.3655\)

Example 2: Orthogonality Check

Are \(\mathbf{u}=\langle 2,3\rangle\) and \(\mathbf{v}=\langle -3,2\rangle\) orthogonal?

\(\mathbf{u}\)
\(\mathbf{v}\)

Example 3: Projection

Find \(\text{proj}_{\mathbf{a}}\,\mathbf{b}\) where \(\mathbf{a}=\langle 2,1\rangle\) and \(\mathbf{b}=\langle 3,4\rangle\).

1
Dot product: \(\mathbf{a}\cdot\mathbf{b}=(2)(3)+(1)(4)=\) 10
2
Magnitude squared: \(\mathbf{a}\cdot\mathbf{a}=4+1=\) 5
3
Vector projection: \(\text{proj}_{\mathbf{a}}\,\mathbf{b}=\frac{10}{5}\langle 2,1\rangle = 2\langle 2,1\rangle =\) \(\langle 4,2\rangle\)

Key Properties

1
Commutative: \(\mathbf{a}\cdot\mathbf{b} = \mathbf{b}\cdot\mathbf{a}\)
2
Distributive: \(\mathbf{a}\cdot(\mathbf{b}+\mathbf{c}) = \mathbf{a}\cdot\mathbf{b}+\mathbf{a}\cdot\mathbf{c}\)
3
Scalar multiplication: \((c\,\mathbf{a})\cdot\mathbf{b} = c(\mathbf{a}\cdot\mathbf{b})\)
4
Self-dot: \(\mathbf{a}\cdot\mathbf{a} = \|\mathbf{a}\|^2 \geq 0\), with equality only when \(\mathbf{a}=\mathbf{0}\)

Common Mistakes

✕ Expecting a Vector
The dot product returns a scalar, not a vector. Writing \(\mathbf{a}\cdot\mathbf{b}=\langle \ldots\rangle\) is always wrong.
✕ Forgetting the Denominator
For the angle: dividing by \(\|\mathbf{a}\|\|\mathbf{b}\|\), not by just one magnitude. Both are needed.
✕ Wrong Projection Formula
Vector projection divides by \(\|\mathbf{a}\|^2\) (or \(\mathbf{a}\cdot\mathbf{a}\)), not by \(\|\mathbf{a}\|\). Then multiply by \(\mathbf{a}\).

Question 1 of 5

Compute \(\langle 2, -1, 3\rangle \cdot \langle 4, 5, -2\rangle\).

Question 2 of 5

If \(\mathbf{a}\cdot\mathbf{b}=0\), what does this tell us about the two vectors?

Question 3 of 5

Find the scalar projection of \(\mathbf{b}=\langle 6,0\rangle\) onto \(\mathbf{a}=\langle 3,4\rangle\).

Question 4 of 5

What is the angle between \(\mathbf{a}=\langle 1,0\rangle\) and \(\mathbf{b}=\langle 1,1\rangle\)?

Question 5 of 5

Find \(\text{proj}_{\mathbf{a}}\,\mathbf{b}\) where \(\mathbf{a}=\langle 1,2\rangle\) and \(\mathbf{b}=\langle 4,3\rangle\).