01 / 20

3D Vectors &
Dot Product

Master vectors in three dimensions and the scalar (dot) product: compute magnitudes, find angles, and test perpendicularity.

IB Mathematics: AI HL

What Is a 3D Vector?

A 3D vector extends the 2D idea by adding a third component along the \(z\)-axis. We write it as a column vector or in component form:

x z y
\(v_1\)
\(v_2\)
\(v_3\)
v O

Magnitude in Three Dimensions

The magnitude (length) of a 3D vector extends the Pythagorean theorem into a third dimension:

A unit vector in the direction of \(\vec{v}\) is obtained by dividing each component by the magnitude:

Why 3D Vectors Matter

Physics
Forces, velocities, and fields all act in three dimensions: gravity, electromagnetism, fluid flow.
Engineering
Structural loads, torque analysis, and robot kinematics require precise 3D vector arithmetic.
Graphics
3D rendering, lighting, and camera positioning are all built on vector and dot-product calculations.

The Dot Product Formula

Given two vectors \(\vec{a} = \begin{pmatrix} a_1\\a_2\\a_3 \end{pmatrix}\) and \(\vec{b} = \begin{pmatrix} b_1\\b_2\\b_3 \end{pmatrix}\), the scalar (dot) product is defined in two equivalent ways:

Component Form
$$\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2 + a_3 b_3$$
Geometric Form
$$\vec{a} \cdot \vec{b} = |\vec{a}|\,|\vec{b}|\cos\theta$$

Geometric Interpretation

a b
\(\theta\)
proj
1
\(\vec{a}\cdot\vec{b} > 0\): vectors point in roughly the same direction (\(\theta < 90°\)).
2
\(\vec{a}\cdot\vec{b} = 0\): vectors are perpendicular (\(\theta = 90°\)).
3
\(\vec{a}\cdot\vec{b} < 0\): vectors point in roughly opposite directions (\(\theta > 90°\)).

Finding the Angle Between Vectors

By equating the two dot product forms, we can isolate the angle \(\theta\):

Perpendicularity Test

Two non-zero vectors \(\vec{a}\) and \(\vec{b}\) are perpendicular (orthogonal) if and only if their dot product is zero:

a b
\(\vec{a}\cdot\vec{b}=0\)

This is the fastest way to check perpendicularity: no need to compute magnitudes or use \(\cos^{-1}\).

Dot vs Cross Product

Dot Product Cross Product
Notation \(\vec{a}\cdot\vec{b}\) \(\vec{a}\times\vec{b}\)
Result type Scalar Vector
Formula uses \(\cos\theta\) \(\sin\theta\)
Measures Alignment / projection Area / perpendicular direction
Zero when Perpendicular Parallel

How to Apply the Dot Product

1
Identify the vectors. Write \(\vec{a}\) and \(\vec{b}\) in component form \(\begin{pmatrix}a_1\\a_2\\a_3\end{pmatrix}\).
2
Compute the dot product. Multiply corresponding components and sum: \(a_1b_1 + a_2b_2 + a_3b_3\).
3
Find magnitudes. \(|\vec{a}|=\sqrt{a_1^2+a_2^2+a_3^2}\) and likewise for \(\vec{b}\).
4
Apply the angle formula. \(\cos\theta = \frac{\vec{a}\cdot\vec{b}}{|\vec{a}|\,|\vec{b}|}\), then \(\theta = \cos^{-1}(\ldots)\).
5
Interpret. Is the angle acute, obtuse, or exactly \(90°\)?

Example 1: Computing the Dot Product

Find \(\vec{a}\cdot\vec{b}\) given \(\vec{a}=\begin{pmatrix}2\\-1\\3\end{pmatrix}\) and \(\vec{b}=\begin{pmatrix}4\\0\\-2\end{pmatrix}\).

1
Multiply components: \((2)(4) + (-1)(0) + (3)(-2)\)
2
Simplify: \(8 + 0 + (-6) = 2\)

Example 2: Finding the Angle

Find the angle between \(\vec{a}=\begin{pmatrix}1\\2\\2\end{pmatrix}\) and \(\vec{b}=\begin{pmatrix}3\\-1\\1\end{pmatrix}\).

1
Dot product: \((1)(3)+(2)(-1)+(2)(1)=3-2+2=\) 3
2
Magnitudes: \(|\vec{a}|=\sqrt{1+4+4}=\) 3, \(|\vec{b}|=\sqrt{9+1+1}=\) \(\sqrt{11}\)
3
Angle formula: \(\cos\theta=\dfrac{3}{3\sqrt{11}}=\dfrac{1}{\sqrt{11}}\)
4
Evaluate: \(\theta=\cos^{-1}\!\left(\dfrac{1}{\sqrt{11}}\right)\approx\) 72.5°

Example 3: Proving Perpendicularity

Show that \(\vec{p}=\begin{pmatrix}2\\1\\-3\end{pmatrix}\) and \(\vec{q}=\begin{pmatrix}1\\4\\2\end{pmatrix}\) are perpendicular.

1
Compute: \(\vec{p}\cdot\vec{q}=(2)(1)+(1)(4)+(-3)(2)\)
2
Simplify: \(2+4-6=\) 0

Properties of the Dot Product

1
Commutative: \(\vec{a}\cdot\vec{b}=\vec{b}\cdot\vec{a}\)
2
Distributive: \(\vec{a}\cdot(\vec{b}+\vec{c})=\vec{a}\cdot\vec{b}+\vec{a}\cdot\vec{c}\)
3
Scalar multiplication: \((k\vec{a})\cdot\vec{b}=k(\vec{a}\cdot\vec{b})\)
4
Self dot product: \(\vec{a}\cdot\vec{a}=|\vec{a}|^2\)

Common Mistakes

✕ Adding instead of multiplying
The dot product multiplies corresponding components: \(a_1b_1\), not \(a_1+b_1\). Then sum the products.
✕ Forgetting the third component
In 3D, always include the \(k\)-component: \(a_3b_3\). A missing term gives a wrong scalar.
✕ Returning a vector
The dot product is a scalar (number), not a vector. If your answer has components, something is wrong.

Summary of Key Formulas

Concept Formula Result
Magnitude \(\sqrt{v_1^2+v_2^2+v_3^2}\) Scalar \(\geq 0\)
Dot product \(a_1b_1+a_2b_2+a_3b_3\) Scalar
Angle \(\cos^{-1}\!\left(\frac{\vec{a}\cdot\vec{b}}{|\vec{a}||\vec{b}|}\right)\) \(0° \leq \theta \leq 180°\)
Perpendicular \(\vec{a}\cdot\vec{b}=0\) \(\theta = 90°\)
Unit vector \(\frac{\vec{v}}{|\vec{v}|}\) Vector, \(|\hat{v}|=1\)

Question 1 of 5

Compute \(\begin{pmatrix}3\\-2\\5\end{pmatrix}\cdot\begin{pmatrix}1\\4\\-1\end{pmatrix}\).

Question 2 of 5

Find the magnitude of \(\vec{v}=\begin{pmatrix}2\\-3\\6\end{pmatrix}\).

Question 3 of 5

If \(\vec{a}\cdot\vec{b}=0\), what can you conclude?

Question 4 of 5

Find the angle between \(\vec{a}=\begin{pmatrix}1\\0\\1\end{pmatrix}\) and \(\vec{b}=\begin{pmatrix}0\\1\\1\end{pmatrix}\).

Question 5 of 5

For which value of \(k\) are \(\vec{u}=\begin{pmatrix}2\\k\\-1\end{pmatrix}\) and \(\vec{w}=\begin{pmatrix}3\\1\\4\end{pmatrix}\) perpendicular?