Dot Product
& Angles Between Vectors
Discover how the dot product reveals the angle between any two vectors: from perpendicularity to parallelism and everything in between.
What Is a Vector?
A vector is a quantity with both magnitude (length) and direction. We write a vector in component form as \(\mathbf{v} = \langle v_1, v_2 \rangle\) in 2D, or \(\mathbf{v} = \langle v_1, v_2, v_3 \rangle\) in 3D.
What Is the Dot Product?
The dot product (also called the scalar product) takes two vectors and returns a single number. For vectors \(\mathbf{a} = \langle a_1, a_2 \rangle\) and \(\mathbf{b} = \langle b_1, b_2 \rangle\):
In general, for \(n\)-dimensional vectors: \(\mathbf{a} \cdot \mathbf{b} = \displaystyle\sum_{i=1}^{n} a_i b_i\). Multiply corresponding components, then add.
Why Does It Matter?
The dot product connects algebra (multiplying components) with geometry (angles and projections). It answers fundamental questions:
The Geometric Definition
There is a second, equivalent way to define the dot product, using magnitudes and the angle between vectors:
Setting the two definitions equal gives us the angle formula: the bridge between algebra and geometry.
The Angle Formula
To find \(\theta\), take the inverse cosine:
where \(\|\mathbf{a}\| = \sqrt{a_1^2 + a_2^2}\) is the magnitude of \(\mathbf{a}\). The result always satisfies \(0 \leq \theta \leq \pi\) (i.e., \(0^\circ\) to \(180^\circ\)).
Sign Tells the Angle
The sign of \(\mathbf{a} \cdot \mathbf{b}\) immediately reveals the relationship between the vectors:
Orthogonality: When \(\mathbf{a} \cdot \mathbf{b} = 0\)
Two non-zero vectors are orthogonal (perpendicular) if and only if their dot product is zero. This is the simplest and most important test in linear algebra.
Example: Let \(\mathbf{a} = \langle 3, 4 \rangle\) and \(\mathbf{b} = \langle -4, 3 \rangle\).
Dot vs Cross Product
| Dot Product | Cross Product | |
|---|---|---|
| Notation | \(\mathbf{a} \cdot \mathbf{b}\) | \(\mathbf{a} \times \mathbf{b}\) |
| Result type | Scalar (number) | Vector |
| Dimensions | Any \(n\) | 3D only |
| Measures | How aligned | How perpendicular |
| Zero when | Perpendicular | Parallel |
| Key formula | \(\|\mathbf{a}\|\|\mathbf{b}\|\cos\theta\) | \(\|\mathbf{a}\|\|\mathbf{b}\|\sin\theta\;\hat{n}\) |
How to Find the Angle
Example 1: 2D Vectors
Find the angle between \(\mathbf{a} = \langle 1, 3 \rangle\) and \(\mathbf{b} = \langle 4, 2 \rangle\).
Example 2: 3D Vectors
Find the angle between \(\mathbf{u} = \langle 1, 0, -1 \rangle\) and \(\mathbf{v} = \langle 0, 1, 1 \rangle\).
Example 3: Orthogonal Check
Are \(\mathbf{p} = \langle 2, -5, 1 \rangle\) and \(\mathbf{q} = \langle 3, 1, -1 \rangle\) orthogonal?
Since \(\mathbf{p}\cdot\mathbf{q} = 0\), the vectors are orthogonal. We don't need magnitudes or \(\cos^{-1}\): the zero result is enough.
Key Properties
Common Mistakes
Summary Table
| Condition | Dot Product | Angle \(\theta\) | Meaning |
|---|---|---|---|
| Same direction | \(\|\mathbf{a}\|\|\mathbf{b}\|\) | \(0^\circ\) | Parallel, same way |
| Acute | > 0 | \(0^\circ < \theta < 90^\circ\) | Somewhat aligned |
| Perpendicular | = 0 | \(90^\circ\) | Orthogonal |
| Obtuse | < 0 | \(90^\circ < \theta < 180^\circ\) | Opposing |
| Opposite direction | \(-\|\mathbf{a}\|\|\mathbf{b}\|\) | \(180^\circ\) | Anti-parallel |
Question 1 of 5
What is the dot product of \(\mathbf{a} = \langle 2, -3 \rangle\) and \(\mathbf{b} = \langle 4, 1 \rangle\)?
Question 2 of 5
If \(\mathbf{u}\cdot\mathbf{v} = 0\) and both vectors are non-zero, what is the angle between them?
Question 3 of 5
What is the angle between \(\mathbf{a} = \langle 1, 1 \rangle\) and \(\mathbf{b} = \langle -1, 1 \rangle\)?
Question 4 of 5
The dot product of two vectors is negative. What can you conclude about the angle \(\theta\) between them?
Question 5 of 5
Find the angle between \(\mathbf{u} = \langle 1, 0, 0 \rangle\) and \(\mathbf{v} = \langle 0, 0, 1 \rangle\).