In this page, we discuss how to calculate the distance between planes, lines, points, and everything in between. We will show why the distance formula is such, but once the formula is concluded, you are not expected to repeat the work but rather use the formula.
It should be clear at this point, that given two points
and
, the distance between them is the magnitude of the vector connecting them, that is:
.
Distance Between a Point and a Line
Theorem 9.1 (Distance Between a Point and a Line): Let
be a point in
and
a line with initial point
and direction vector
. The shortest distance
from the point
to the line
is given by the ratio of the magnitude of their vector cross product to the magnitude of the direction vector.
![Rendered by QuickLaTeX.com \[d(M, \ell) = \frac{\|\overrightarrow{AM} \times \vec{u}\|}{\|\vec{u}\|}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-ab44aa10a4aff12e36b4d738300006c0_l3.png)
In the formula above,
is any point belong to the line.
Example: Calculate the shortest distance
from the point
to the line
given by the parametric equations:
![Rendered by QuickLaTeX.com \[\ell: \begin{cases} x = 1 + 2t \\ y = -1 - t \\ z = 2 + 2t \end{cases}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-1780084999a472192107a9c16e4b9f29_l3.png)
Distance Between Parallel Lines
If two lines are parallel, pick a point on any one line, and use the formula above to calculate the distance from that point to the other line.
Example: Calculate the distance
between the two parallel lines
and
given by:
![Rendered by QuickLaTeX.com \[\ell_1: \begin{cases} x = 1 + t \\ y = 2t \\ z = -1 - t \end{cases} \quad \text{and} \quad \ell_2: \begin{cases} x = 2 + s \\ y = 2 + 2s \\ z = 1 - s \end{cases}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-963689371342d17f1f7b2562fae98582_l3.png)
Distance Between a Point and a Plane
Theorem 9.2: Let
be a point in
and
a plane. The distance between them is given by:
![]()
Example: Calculate the shortest distance
from the point
to the plane
defined by the Cartesian equation
.
Distance Between Two Parallel Planes
As before, if two planes are parallel, pick a point belong to one of the planes and use the formula above to find the distance between that point and the other plane.
Example: Calculate the distance
between the two parallel planes
and
given by their Cartesian equations:
![]()
Distance Between Skew Lines
To find the distance between skew lines, we need to find the points on the lines that are closest to one another. In order to do that, we take general points on each line (using each equation of the line), and create a generic vector
. Since
will represent the distance, it needs to be perpendicular to both
and
. Therefore, the scalar product with the direction vectors of both lines must be 0. Since
will depend on the parameters of the lines, and each scalar product yields an equation, this will give two equations with two variables. Finding the parameters, we can replace them to conclude
,
, and
from which we conclude the distance.

Alternatively, we can argue that this double perpendicularity condition can be used as:
![]()
We will see examples using both methods and then conclude the formula.
Example: Find the distance between the skew lines given in vector form by analyzing the perpendicular properties of their shortest connecting segment:
![Rendered by QuickLaTeX.com \[\ell_1: \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} + t\begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix} \quad \text{and} \quad \ell_2: \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 3 \\ -1 \\ 4 \end{pmatrix} + s\begin{pmatrix} -1 \\ 2 \\ -1 \end{pmatrix} \quad \text{with } s, t \in \mathbb{R}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-87ef714f6e7a956f452d4a065be8e70e_l3.png)
Example: Find the distance between the skew lines given in vector form by:
![Rendered by QuickLaTeX.com \[\ell_1: \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix} + t\begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix} \quad \text{and} \quad \ell_2: \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 3 \\ -1 \\ 4 \end{pmatrix} + s\begin{pmatrix} -1 \\ 2 \\ -1 \end{pmatrix} \quad \text{with } s, t \in \mathbb{R}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-87ef714f6e7a956f452d4a065be8e70e_l3.png)
Theorem (Distance Between Two Skew Lines): Let
and
be two skew lines in three-dimensional space
. Let
be a fixed point on
with direction vector
, and let
be a fixed point on
with direction vector
. The distance
between the two lines is given:
![Rendered by QuickLaTeX.com \[d(\ell_1, \ell_2) = \frac{|\overrightarrow{A_1A_2} \cdot (\vec{v} \times \vec{u})|}{\|\vec{v} \times \vec{u}\|}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-eda01b9f5c2e028433946d19a5a3f71f_l3.png)
The numerator in this formula is called the scalar triple product and represents the volume of a parallelepiped created by those vectors (we will see this later). Divided by the area of the basis, that gives the “height” which in this case is the distance between the lines. Just a way to think about where the formula comes from and why you can use any points that you want.
Finally, note that we cannot use this formula for parallel lines because the vector product would not be defined if the two vectors were parallel.
Exercises
For each problem below, find the shortest distance
from the given point
to the line
in
.
- 1. Point
and line 
- 2. Point
and line 
- 3. Point
and line 
Analyze each pair of lines below to determine their geometric relationship, then calculate the shortest distance
between them in
.
- 1.

- 2.

- 3.

For each problem below, apply the point-to-plane distance formula to calculate the shortest perpendicular distance
from the given point
to the plane
.
- 1. Point
and plane 
- 2. Point
and plane 
- 3. Point
and plane 
Verify that each pair of planes below is parallel, choose an arbitrary reference point on the first plane, and calculate the shortest distance separating them.
- 1.

- 2.

- 3.

For each pair of skew lines below, use either the orthogonality dot product system or the scalar triple product formula to determine the shortest geometric distance separating them in
.
- 1.

- 2.

- 3.


![Rendered by QuickLaTeX.com \[\frac{1}{2} \cdot d \cdot \|\vec{u}\| = \frac{1}{2} \|\vec{u} \times \overrightarrow{AM}\| \implies d = \frac{\|\vec{u} \times \overrightarrow{AM}\|}{\|\vec{u}\|}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-c8ae275f2341038371cbae3d35efc621_l3.png)
![Rendered by QuickLaTeX.com \[A(1, -1, 2), \quad \vec{u} = \begin{pmatrix} 2 \\ -1 \\ 2 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-14bae31fd2482230ede9d1b709cac244_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AM} = \begin{pmatrix} 2 - 1 \\ 1 - (-1) \\ 3 - 2 \end{pmatrix} = \begin{pmatrix} 1 \\ 2 \\ 1 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-de142a9a391e2ccc3c94d3a0d21ca90a_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AM} \times \vec{u} = \begin{pmatrix} (2)(2) - (1)(-1) \\ (1)(2) - (1)(2) \\ (1)(-1) - (2)(2) \end{pmatrix} = \begin{pmatrix} 4 + 1 \\ 2 - 2 \\ -1 - 4 \end{pmatrix} = \begin{pmatrix} 5 \\ 0 \\ -5 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-11e378d5c701ee56283264ca5350b20d_l3.png)
![Rendered by QuickLaTeX.com \[d(M, \ell) = \frac{\|\overrightarrow{AM} \times \vec{u}\|}{\|\vec{u}\|} = \frac{5\sqrt{2}}{3}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-2bf26add2cf52e972070bc2ec47c3a5a_l3.png)
![Rendered by QuickLaTeX.com \[A(2, 2, 1), \quad \vec{u} = \begin{pmatrix} 1 \\ 2 \\ -1 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-fcd3a570a6aa248b069ebf9c111fbfeb_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AP} = \begin{pmatrix} 1 - 2 \\ 0 - 2 \\ -1 - 1 \end{pmatrix} = \begin{pmatrix} -1 \\ -2 \\ -2 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-f7ec94ff9fa2bcf7951ff349e66f7276_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AP} \times \vec{u} = \begin{pmatrix} (-2)(-1) - (-2)(2) \\ (-2)(1) - (-1)(-1) \\ (-1)(2) - (-2)(1) \end{pmatrix} = \begin{pmatrix} 2 + 4 \\ -2 - 1 \\ -2 + 2\end{pmatrix} = \begin{pmatrix} 6 \\ -3 \\ 0 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-36b426efb1e78cac613a8952513a337c_l3.png)
![Rendered by QuickLaTeX.com \[d(\ell_1, \ell_2) = \frac{\|\overrightarrow{AP} \times \vec{u}\|}{\|\vec{u}\|} = \frac{3\sqrt{5}}{\sqrt{6}} = \frac{3\sqrt{30}}{6} = \frac{\sqrt{30}}{2}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-e96808679cfde184b393547515c60709_l3.png)

![Rendered by QuickLaTeX.com \[d(M,\pi) = \frac{|\langle\overrightarrow{AM}, \vec{n}\rangle|}{\|\overrightarrow{AM}\| \cdot \|\vec{n}\|} \cdot \|\overrightarrow{AM}\| = \frac{|\langle\overrightarrow{AM}, \vec{n}\rangle|}{\|\vec{n}\|} = \frac{|a \cdot x_1 + b \cdot y_1 + c \cdot z_1 + d|}{\sqrt{a^2 + b^2 + c^2}}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-7f372040e4f9d5e4a1c6047f6e1b08a3_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AM} = \begin{pmatrix} x_1 - x_2 \\ y_1 - y_2 \\ z_1 - z_2 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-a7d71b227de60b7cc6ac58e725ba3fae_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AB} = \begin{pmatrix} 3 - s - t \\ -2 + 2s + t \\ 2 - s - t \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-86f9dde643099a4a4c446adacd1a8d8f_l3.png)
and
:![Rendered by QuickLaTeX.com \[\begin{cases} \overrightarrow{AB} \cdot \vec{u} = 0 \implies (3 - s - t)(1) + (-2 + 2s + t)(-1) + (2 - s - t)(1) = 0 \\ \overrightarrow{AB} \cdot \vec{v} = 0 \implies (3 - s - t)(-1) + (-2 + 2s + t)(2) + (2 - s - t)(-1) = 0 \end{cases}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-59106791e166c07d06b7ab4425182a34_l3.png)
![Rendered by QuickLaTeX.com \[\begin{cases} 3 - s - t + 2 - 2s - t + 2 - s - t = 0 \implies -4s - 3t = -7 \quad \text{(Eq. 1)} \\ -3 + s + t - 4 + 4s + 2t - 2 + s + t = 0 \implies 6s + 4t = 9 \quad \text{(Eq. 2)} \end{cases}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-afbb76abbff202e095454204c476bfa6_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AB} = \begin{pmatrix} 3.5 - 3 \\ -2 - (-2) \\ 4.5 - 5 \end{pmatrix} = \begin{pmatrix} 0.5 \\ 0 \\ -0.5 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-027c0a745408bb03e4320ea19292e4dc_l3.png)
![Rendered by QuickLaTeX.com \[\overrightarrow{AB} = \begin{pmatrix} 3 - s - t \\ -1 + 2s - (1 - t) \\ 4 - s - (2 + t) \end{pmatrix} = \begin{pmatrix} 3 - s - t \\ -2 + 2s + t \\ 2 - s - t \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-5bbd67f92ff24eef52e7563dd171bc71_l3.png)
![Rendered by QuickLaTeX.com \[\vec{v} = \begin{pmatrix} 1 \\ -1 \\ 1 \end{pmatrix} \quad \text{and} \quad \vec{w} = \begin{pmatrix} -1 \\ 2 \\ -1 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-749da241e3f5eb031d00f844aa521a19_l3.png)
![Rendered by QuickLaTeX.com \[\vec{v} \times \vec{w} = \begin{pmatrix} (-1)(-1) - (1)(2) \\ (1)(-1) - (1)(-1) \\ (1)(2) - (-1)(-1) \end{pmatrix} = \begin{pmatrix} -1 \\ 0 \\ 1 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-a094e05492d579f3554fae0987b25958_l3.png)
![Rendered by QuickLaTeX.com \[\begin{cases} 3 - s - t = -k \\ -2 + 2s + t = 0 \\ 2 - s - t = k \end{cases}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-d12e969eedc18076b87f318388403126_l3.png)
![Rendered by QuickLaTeX.com \[1 = -2k \implies k = -0.5 \implies \overrightarrow{AB} = \begin{pmatrix} 0.5 \\ 0 \\ -0.5 \end{pmatrix}\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-68a632c04db918a6e9e43adc7739b995_l3.png)