01 / 21
\(y\)
\(x\)
\(z\)

Distance Formulas
in 3D Space

Master the three essential distance computations in \(\mathbb{R}^3\): point-to-point, point-to-line, and point-to-plane.

Calculus 3

Why 3D Distances Matter

In two dimensions, distance is a single formula. But in three-dimensional space, objects come in different shapes: points, lines, and planes. Measuring the shortest distance between them requires distinct approaches that build on each other.

Point ↔ Point
Direct extension of the 2D formula using three coordinates.
Point ↔ Line
Uses the cross product to find the perpendicular distance.
Point ↔ Plane
Uses the dot product and the plane's normal vector.

Coordinates in \(\mathbb{R}^3\)

\(x\)
\(y\)
\(z\)
\(P(x_1, y_1, z_1)\)
\(Q(x_2, y_2, z_2)\)
\(d\)

Key Vector Tools You'll Need

All three distance formulas rely on two fundamental vector operations. Make sure you're comfortable with these before proceeding.

Dot Product
\(\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2 + a_3 b_3\)

Measures projection: how much one vector lies along another.
Cross Product
\(\vec{a} \times \vec{b}\) produces a vector perpendicular to both, with magnitude equal to the area of the parallelogram they span.

Point-to-Point Distance

This is the direct generalization of the Pythagorean theorem to three dimensions. You're computing the magnitude of the vector \(\vec{PQ}\):

Point-to-Line Distance

\(L\)
\(Q\)
\(\vec{d}\)
\(P\)
\(\vec{QP}\)
\(d\)

Why the Cross Product Works

1
\(\|\vec{QP} \times \vec{d}\|\) gives the area of the parallelogram formed by \(\vec{QP}\) and \(\vec{d}\).
2
\(\text{Area} = \text{base} \times \text{height}\). The base is \(\|\vec{d}\|\) and the height is the perpendicular distance we want.
3
Solving for height: \(\displaystyle d = \frac{\text{Area}}{\text{base}} = \frac{\|\vec{QP} \times \vec{d}\|}{\|\vec{d}\|}\).

Point-to-Plane Distance

Plane \(\pi\)
\(\vec{n}\)
\(Q\)
\(P\)
\(\vec{QP}\)
\(d\)

Why the Dot Product Works

1
Pick any point \(Q\) on the plane. Form \(\vec{QP}\).
2
Project \(\vec{QP}\) onto \(\vec{n}\): the scalar projection is \(\displaystyle\frac{|\vec{QP} \cdot \vec{n}|}{\|\vec{n}\|}\).
3
This gives the unsigned perpendicular distance.
4
Substituting \(\vec{QP} \cdot \vec{n} = ax_0 + by_0 + cz_0 + d\) yields the closed-form formula.

Cross Product vs. Dot Product

Point-to-Line Point-to-Plane
Operation Cross product Dot product
Numerator \(\|\vec{QP} \times \vec{d}\|\) \(|\vec{QP} \cdot \vec{n}|\)
Denominator \(\|\vec{d}\|\) \(\|\vec{n}\|\)
Geometric idea Parallelogram area / base Scalar projection onto normal
Result type Scalar (always \(\geq 0\)) Scalar (always \(\geq 0\))

Step-by-Step Strategy

1
Identify the objects. Are you measuring point-to-point, point-to-line, or point-to-plane?
2
Extract the key vectors. Find \(\vec{QP}\) and the direction \(\vec{d}\) (for lines) or normal \(\vec{n}\) (for planes).
3
Apply the right operation. Cross product for lines, dot product for planes, magnitude for points.
4
Divide by the denominator. \(\|\vec{d}\|\) for lines, \(\|\vec{n}\|\) for planes.
5
Simplify. Reduce radicals and verify the answer is positive.

Example 1: Point-to-Point

Find the distance between \(A(1, 2, 3)\) and \(B(4, 6, 3)\).

1
Differences: \(\Delta x = 4 - 1 = 3\), \(\Delta y = 6 - 2 = 4\), \(\Delta z = 3 - 3 = 0\).
2
Substitute: \(d = \sqrt{3^2 + 4^2 + 0^2} = \sqrt{9 + 16 + 0}\).
3
Result: \(d = \sqrt{25} = 5\).

Example 2: Point-to-Line

Find the distance from \(P(1, 0, -1)\) to the line through \(Q(0, 1, 2)\) with direction \(\vec{d} = \langle 1, 1, 0 \rangle\).

1
Compute \(\vec{QP}\): \(\langle 1 - 0,\; 0 - 1,\; -1 - 2 \rangle = \langle 1, -1, -3 \rangle\).
2
Cross product: \(\vec{QP} \times \vec{d} = \begin{vmatrix} \vec{i} & \vec{j} & \vec{k} \\ 1 & -1 & -3 \\ 1 & 1 & 0 \end{vmatrix} = \langle 3, -3, 2 \rangle\).
3
Magnitudes: \(\|\vec{QP} \times \vec{d}\| = \sqrt{9 + 9 + 4} = \sqrt{22}\), \(\|\vec{d}\| = \sqrt{1^2+1^2+0^2} = \sqrt{2}\).
4
Result: \(\displaystyle d = \frac{\sqrt{22}}{\sqrt{2}} = \sqrt{11}\).

Example 3: Point-to-Plane

Find the distance from \(P(2, 3, 1)\) to the plane \(2x - y + 2z - 4 = 0\).

1
Identify: \(a=2\), \(b=-1\), \(c=2\), \(d=-4\).
2
Numerator: \(|2(2) + (-1)(3) + 2(1) - 4| = |4 - 3 + 2 - 4| = |-1| = 1\).
3
Denominator: \(\sqrt{2^2 + (-1)^2 + 2^2} = \sqrt{4 + 1 + 4} = \sqrt{9} = 3\).
4
Result: \(\displaystyle d = \frac{1}{3}\).

Common Mistakes

✕ Forgetting Absolute Value
The point-to-plane numerator needs \(|ax_0 + by_0 + cz_0 + d|\). A negative result from the dot product doesn't mean negative distance.
✕ Wrong Product Type
Using the dot product for point-to-line (need cross), or the cross product for point-to-plane (need dot).
✕ Mixing Up \(\vec{d}\) and \(\vec{n}\)
Direction vectors define lines; normal vectors define planes. Swapping them yields a meaningless answer.
✕ Confusing \(d\) and \(\vec{d}\)
The scalar constant \(d\) in the plane equation \(ax+by+cz+d=0\) is completely different from the direction vector \(\vec{d}\) of a line.

Formula Summary

Distance Type Formula Key Operation
Point-to-Point \(\|\vec{PQ}\|\) Magnitude
Point-to-Line \(\dfrac{\|\vec{QP} \times \vec{d}\|}{\|\vec{d}\|}\) Cross product
Point-to-Plane \(\dfrac{|ax_0+by_0+cz_0+d|}{\sqrt{a^2+b^2+c^2}}\) Dot product

Question 1 of 5

What is the distance between \(A(1, -2, 4)\) and \(B(3, 0, 6)\)?

Question 2 of 5

Which vector operation do you use to find the distance from a point to a line?

Question 3 of 5

Find the distance from \(P(0, 0, 0)\) to the plane \(x + 2y + 2z = 9\).

Question 4 of 5

In the point-to-plane formula, why must the numerator include absolute value bars?

Question 5 of 5

A line passes through \(Q(1, 0, 0)\) with direction \(\vec{d} = \langle 0, 0, 1 \rangle\). Find the distance from \(P(3, 4, 0)\) to the line.