01 / 21

3D Vectors
Components, Magnitude & Unit Vectors

Extend your vector toolkit into three dimensions: learn to describe direction and distance in space using \(\mathbf{i}\), \(\mathbf{j}\), \(\mathbf{k}\) components.

IB Mathematics: Analysis & Approaches

What Is a 3D Vector?

A 3D vector is a quantity with both magnitude and direction in three-dimensional space. While 2D vectors live on a flat plane, 3D vectors add a third axis: the \(z\)-axis, which points "out" of the page.

Here \(\mathbf{i}\), \(\mathbf{j}\), and \(\mathbf{k}\) are the standard unit basis vectors along the \(x\), \(y\), and \(z\) axes respectively.

The 3D Coordinate System

O \(x\) \(y\) \(z\) \(\mathbf{i}\) \(\mathbf{j}\) \(\mathbf{k}\) \(\mathbf{v}\)

Why 3D Vectors Matter

Physics
Forces, velocities, and fields all act in 3D: gravity pulls down, wind blows sideways, lift pushes up.
Engineering
3D CAD models, structural analysis, and robotics all rely on vector arithmetic in space.
Computer Graphics
Every vertex in a 3D game or animation is a vector: lighting, camera angles, and motion all use them.

In the IB HL syllabus (AHL 3.9), mastering 3D vectors opens the door to scalar and cross products, lines, and planes in space.

Components of a 3D Vector

Given two points \(A(x_1, y_1, z_1)\) and \(B(x_2, y_2, z_2)\), the vector from \(A\) to \(B\) is:

Each component tells you how far to travel along each axis to get from \(A\) to \(B\). Consistent with the diagram shown earlier, the \(x\)-component is depth, the \(y\)-component is horizontal, and the \(z\)-component is vertical.

Magnitude in 3D

\(a\) \(b\) \(c\) \(|\mathbf{v}|\) \(\sqrt{a^2 + b^2}\)

This is the 3D Pythagorean theorem: first find the diagonal on the base (\(\sqrt{a^2 + b^2}\)), then use it with \(c\) to find the space diagonal.

Unit Vectors in 3D

A unit vector has magnitude exactly \(1\). It captures direction only, with no information about length. To find the unit vector \(\hat{\mathbf{v}}\) in the direction of \(\mathbf{v}\):

\(\mathbf{i}\)
\(\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}\) : unit vector along the \(x\)-axis
\(\mathbf{j}\)
\(\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}\) : unit vector along the \(y\)-axis
\(\mathbf{k}\)
\(\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}\) : unit vector along the \(z\)-axis

Position vs Displacement Vectors

Position Vector Displacement Vector
Definition From origin \(O\) to point \(P\) From point \(A\) to point \(B\)
Notation \(\overrightarrow{OP}\) or \(\mathbf{p}\) \(\overrightarrow{AB}\)
Formula \(\begin{pmatrix} x \\ y \\ z \end{pmatrix}\) \(\mathbf{b} - \mathbf{a}\)
Start point Always the origin Any point \(A\)
Example Where is the drone? How far did it move?

Vector Operations in 3D

Addition
\(\mathbf{u} + \mathbf{v} = \begin{pmatrix} u_1 + v_1 \\ u_2 + v_2 \\ u_3 + v_3 \end{pmatrix}\)
Scalar Mult.
\(k\mathbf{v} = \begin{pmatrix} kv_1 \\ kv_2 \\ kv_3 \end{pmatrix}\)
Subtraction
\(\mathbf{u} - \mathbf{v} = \begin{pmatrix} u_1 - v_1 \\ u_2 - v_2 \\ u_3 - v_3 \end{pmatrix}\)

How to Find a Unit Vector

1
Identify the vector. Write \(\mathbf{v} = \begin{pmatrix} a \\ b \\ c \end{pmatrix}\).
2
Calculate the magnitude. Compute \(|\mathbf{v}| = \sqrt{a^2 + b^2 + c^2}\).
3
Divide each component. \(\hat{\mathbf{v}} = \frac{1}{|\mathbf{v}|}\begin{pmatrix} a \\ b \\ c \end{pmatrix}\).
4
Verify. Check that \(|\hat{\mathbf{v}}| = 1\) by computing \(\sqrt{\hat{v}_1^2 + \hat{v}_2^2 + \hat{v}_3^2}\).

Example 1: Finding Components

Find the vector \(\overrightarrow{AB}\) given \(A(1, 3, -2)\) and \(B(4, -1, 5)\).

1
Apply the formula: \(\overrightarrow{AB} = \mathbf{b} - \mathbf{a}\).
2
Subtract component-by-component: \(\overrightarrow{AB} = \begin{pmatrix} 4 - 1 \\ -1 - 3 \\ 5 - (-2) \end{pmatrix} = \begin{pmatrix} 3 \\ -4 \\ 7 \end{pmatrix}\)

Example 2: Magnitude

Find \(|\overrightarrow{AB}|\) for \(\overrightarrow{AB} = \begin{pmatrix} 3 \\ -4 \\ 7 \end{pmatrix}\).

1
Square each component: \(3^2 = 9\), \((-4)^2 = 16\), \(7^2 = 49\).
2
Sum the squares: \(9 + 16 + 49 = 74\).
3
Take the square root: \(|\overrightarrow{AB}| = \sqrt{74} \approx 8.60\).

Example 3: Unit Vector

Find the unit vector in the direction of \(\mathbf{v} = \begin{pmatrix} 2 \\ -6 \\ 3 \end{pmatrix}\).

1
Magnitude: \(|\mathbf{v}| = \sqrt{4 + 36 + 9} = \sqrt{49} = 7\).
2
Divide: \(\hat{\mathbf{v}} = \frac{1}{7}\begin{pmatrix} 2 \\ -6 \\ 3 \end{pmatrix} = \begin{pmatrix} 2/7 \\ -6/7 \\ 3/7 \end{pmatrix}\).
3
Verify: \(\sqrt{(2/7)^2 + (-6/7)^2 + (3/7)^2} = \sqrt{4+36+9}/7 = 7/7 = 1\) ✓

Parallel and Anti-Parallel Vectors

Two vectors \(\mathbf{u}\) and \(\mathbf{v}\) are parallel if one is a scalar multiple of the other: \(\mathbf{u} = k\mathbf{v}\) for some \(k \in \mathbb{R}\), \(k \neq 0\).

Same direction
If \(k > 0\), vectors point the same way. Example: \(\begin{pmatrix}2\\4\\6\end{pmatrix} = 2\begin{pmatrix}1\\2\\3\end{pmatrix}\).
Opposite direction
If \(k < 0\), vectors are anti-parallel. Example: \(\begin{pmatrix}-3\\6\\-9\end{pmatrix} = -3\begin{pmatrix}1\\-2\\3\end{pmatrix}\).

Common Mistakes to Avoid

✕ Wrong subtraction order
Writing \(\overrightarrow{AB} = \mathbf{a} - \mathbf{b}\) instead of \(\mathbf{b} - \mathbf{a}\). Remember: "destination minus start."
✕ Forgetting to square
Computing \(|\mathbf{v}| = \sqrt{a + b + c}\) instead of \(\sqrt{a^2 + b^2 + c^2}\). Every component must be squared first.
✕ Magnitude of unit vector \(\neq 1\)
Dividing by a wrong magnitude or forgetting to divide all three components. Always verify \(|\hat{\mathbf{v}}| = 1\).

Summary of Key Formulas

Concept Formula Result Type
Components \(\overrightarrow{AB} = \mathbf{b} - \mathbf{a}\) Vector
Magnitude \(|\mathbf{v}| = \sqrt{a^2 + b^2 + c^2}\) Scalar
Unit vector \(\hat{\mathbf{v}} = \mathbf{v} / |\mathbf{v}|\) Vector (\(|\hat{\mathbf{v}}|=1\))
Distance \(d = |\overrightarrow{AB}|\) Scalar
Parallel test \(\mathbf{u} = k\mathbf{v}\), \(k \neq 0\) Boolean

Question 1 of 5

Given \(A(2, -1, 4)\) and \(B(5, 3, -2)\), what is \(\overrightarrow{AB}\)?

Question 2 of 5

What is the magnitude of \(\mathbf{v} = \begin{pmatrix} 1 \\ -2 \\ 2 \end{pmatrix}\)?

Question 3 of 5

Which of the following is the unit vector in the direction of \(\begin{pmatrix} 0 \\ 3 \\ -4 \end{pmatrix}\)?

Question 4 of 5

Are the vectors \(\mathbf{u} = \begin{pmatrix} 6 \\ -9 \\ 3 \end{pmatrix}\) and \(\mathbf{v} = \begin{pmatrix} -2 \\ 3 \\ -1 \end{pmatrix}\) parallel?

Question 5 of 5

A particle moves from \(P(1, 0, -3)\) to \(Q(4, 4, 1)\). What is the distance \(PQ\)?