Geometry

Distance from a point to a line

A point sits off to one side of a straight line. Of all the ways to walk from the point to the line, which one is shortest, and how long is it? And when two lines never meet at all, how far apart are they?

Where you are 4 in Parallel lines and transversals

Why this exists

Between two points there is no argument about distance: you measure the straight segment joining them. Between a point and a line there is. A house stands back from a straight road. Walk to the road at a slant and you cover one length; walk at a steeper slant and you cover another. A line has infinitely many points, so there are infinitely many segments from the house to the road.

For “the distance from the house to the road” to mean anything, one of those segments has to be singled out, the same one for everybody. The shortest is the natural choice, and the surprise is how easy it is to find: it is the one that meets the road at a right angle.

The same question comes back for two lines that never meet. Railway rails are a fixed gauge apart, and a shelf is a fixed height above the one below it, yet two parallel lines have no crossing point to measure from. You could drop the perpendicular from a point of one line to the other, but two worries stand in the way. That segment is square to the line it lands on; is it square to the line it started from, or has it been measured along a slant? And would a different starting point give a different number? The perpendicular transversal theorem settles the first worry and a short congruence argument settles the second, and together they make “the distance between two parallel lines” a single number.

Definition

Let P be a point and \ell a line. Drop the perpendicular from P to \ell: the line through P that meets \ell at a right angle. It crosses \ell at a point Q, called the foot of the perpendicular.

The distance from P to \ell is the length PQ.

If P lies on \ell, then P is its own foot and the distance is 0.

P Q X Y
\ell
Figure 1Many segments join P to \ell. The one that meets \ell at a right angle is the shortest.

In Figure 1, \overline{PQ} \perp \ell, so the distance from P to \ell is PQ. The dashed segments \overline{PX} and \overline{PY} also join P to \ell, but neither of them is the distance.

The definition makes sense only because the foot is a single point. Through a point off a line there is exactly one line perpendicular to it, as the lesson on perpendicular lines proves, so there is exactly one Q and one length PQ. To draw it with no protractor, see constructing a perpendicular from a point off a line.

Distance between parallel lines

Two lines in a plane are parallel when they never meet, written \ell \parallel m. A transversal is a line that crosses two or more other lines at different points.

Let \ell and m be parallel lines in a plane. Pick any point P on \ell and drop the perpendicular from P to m, meeting it at Q. The distance between \ell and m is the length PQ.

d
d
d
\ell
m
Figure 2Measured square across, the gap between two parallel lines is the same wherever you measure it.

Figure 2 shows three such drops, all of the same length d. Two results below are what let the definition say “any point”: by the perpendicular transversal theorem each drop is square to \ell as well as to m, so it is also the perpendicular from Q back to \ell; and the drops all have the same length.

Intuition

Tie a weight to a string and hold the end at P, above a level floor. The weight hangs straight down, and the string meets the floor square. Swing it to one side and the string would have to stretch to reach the floor, because it now runs at a slant.

That is the whole idea for a point and a line: any slant costs extra length. Leaning away from the perpendicular in either direction adds a sideways part to the trip, and the further along the line you aim from Q, the longer the path gets.

For two parallel lines, think of what “parallel” means: the two lines point in the same direction. A transversal crosses both at the same slant, because the slant is decided by the transversal’s direction against that shared direction, and both crossings see the same pair of directions. This is exactly what corresponding angles say. A right angle is just one particular slant, so a transversal square to one parallel is square to the other.

Now slide a set square along one rail, with one edge on the rail and the other edge reaching across. Where the edge meets the second rail, mark the length. The picture the set square sees never changes as it slides: the same right angle, the same shape, the same length. That sameness is why two parallel lines have one distance.

Results

The perpendicular is shortest

If Q is the foot of the perpendicular from P to \ell, then

PX > PQ

for every point X on \ell other than Q.

So the distance from a point to a line is the shortest distance from the point to any point of the line, and it is reached at exactly one point, the foot.

How much longer. If P is at distance d from \ell, and X is on \ell with QX = t, then

PX = \sqrt{d^2 + t^2}

so points of \ell further from the foot are further from P.

Horizontal and vertical lines. On the coordinate plane, the distance from the point (a, b) to the horizontal line y = c is |b - c|, and to the vertical line x = c it is |a - c|.

The perpendicular transversal theorem

In a plane, if a transversal is perpendicular to one of two parallel lines, it is perpendicular to the other one too.

\ell \parallel m,\ t \perp \ell \quad\Longrightarrow\quad t \perp m
\ell
m
t
Figure 3If \ell \parallel m and t \perp \ell, then t \perp m. Matching arrowheads mark the parallel lines.

In Figure 3 the right angle is given at \ell. The theorem is what lets you draw the second square mark at m without measuring. When this happens, all eight angles at the two crossings are right angles.

The companion runs the other way, from two right angles to parallel lines.

Two perpendiculars to one line. In a plane, if two different lines are both perpendicular to the same line, they are parallel to each other.

a \perp t,\ b \perp t \quad\Longrightarrow\quad a \parallel b

The first result carries a right angle across a pair of parallel lines. The second builds a pair of parallel lines out of two right angles, which is how parallel lines are usually constructed in practice: two perpendiculars to one line.

The distance between parallel lines

Parallel lines are everywhere the same distance apart. If \ell \parallel m, every point of m is the same distance from \ell, and every point of \ell is that same distance from m. That common value d is the distance between the lines.

The square drop is the shortest link. Every segment with one end on \ell and the other on m has length at least d, and the length is exactly d only when the segment is perpendicular to the lines.

Horizontal and vertical lines. The lines y = p and y = q are |p - q| apart, and so are the lines x = p and x = q.

Lines in slope-intercept form. Two non-vertical lines with the same slope k, y = kx + b_1 and y = kx + b_2, are

d = \frac{|b_1 - b_2|}{\sqrt{1 + k^2}}

apart. The top is the vertical gap between the lines; dividing by \displaystyle \sqrt{1 + k^2} turns it into the square gap.

Lines in standard form. The parallel lines ax + by = c_1 and ax + by = c_2, with a and b not both zero, are

d = \frac{|c_1 - c_2|}{\sqrt{a^2 + b^2}}

apart. Both equations must use the same a and the same b.

Why it is true

The perpendicular is shortest

By the Pythagorean theorem. Take any point X on \ell other than Q. The segments \overline{PQ}, \overline{QX} and \overline{PX} form a triangle with a right angle at Q, as in Figure 4.

P Q X
P'
\ell
Figure 4Two reasons PX is longer than PQ. \overline{PX} is the long side of a right triangle, and the trip P \to X \to P' bends where P \to Q \to P' goes straight.

By the Pythagorean theorem,

PX^2 = PQ^2 + QX^2

X is not Q, so QX > 0 and QX^2 > 0. That makes PX^2 > PQ^2, and since both lengths are positive, PX > PQ. With PQ = d and QX = t the same equation reads PX^2 = d^2 + t^2, which is the “how much longer” result.

By a mirror, without Pythagoras. Reflect P across \ell to get P', the same distance below \ell that P is above it. The segment \overline{PP'} crosses \ell at Q and is cut in half there, so PP' = 2PQ. A reflection keeps lengths, so P'X = PX.

Now compare two trips from P to P'. Going through Q is a straight segment. Going through X bends at X, since \ell meets \overline{PP'} only at Q, so X is not on it. By the triangle inequality, the bent trip is longer:

\begin{aligned} PX + XP' &> PP' \\ 2PX &> 2PQ \\ PX &> PQ \end{aligned}

The horizontal and vertical cases need no proof beyond the definition. The perpendicular from (a, b) to y = c is the vertical line x = a, so the foot is (a, c), and two points on one vertical line are |b - c| apart, as in horizontal and vertical distance.

The perpendicular transversal theorem

Let \ell \parallel m, and let t cross \ell at P with t \perp \ell.

1 2
\ell
m
t
P
Q
Figure 5\angle 1 and \angle 2 are corresponding angles, so they are equal.

First, t has to reach m at all. Suppose it did not. Then t would be parallel to m, and so would \ell. That gives two different lines through P, both parallel to m. The parallel postulate says there is only one line through P parallel to m, so this cannot happen. Hence t crosses m at some point Q.

Next, carry the right angle across. In Figure 5, \angle 1 at P is the angle above \ell and to the right of t, and it is a right angle. At Q, \angle 2 is the angle above m and to the right of t: the same position at the other crossing. They are corresponding angles, and because \ell \parallel m, corresponding angles are congruent:

m\angle 2 = m\angle 1 = 90^\circ

Finally, one right angle is enough. A right angle at a crossing forces all four angles there to be right angles: the angle opposite is equal to it by vertical angles, and each neighbor forms a linear pair with it, so measures 180^\circ - 90^\circ = 90^\circ. So t meets m at right angles, and t \perp m.

The companion. Suppose a \perp t at P and b \perp t at a different point Q. The angles a and b make with t in matching positions are both 90^\circ, so a pair of corresponding angles are equal. Equal corresponding angles force the lines to be parallel; that is the corresponding angles theorem run in reverse, which is how you go about proving lines parallel. So a \parallel b.

The two results are converses of each other, but neither one gives you the other for free, and they rest on different ground. The first needs the parallel postulate, to know that t reaches m and that corresponding angles are equal. The second does not: Euclid proves it in Book I, Propositions 27 and 28, before he uses the postulate for the first time, in Proposition 29.

Parallel lines are everywhere the same distance apart

Let \ell \parallel m, and let X and Y be two different points of m. Drop perpendiculars from them to \ell, with feet X' and Y'.

X
Y
X'
Y'
m
\ell
Figure 6The diagonal \overline{XY'} splits the rectangle into two congruent triangles, so XX' = YY'.

The segments \overline{XX'} and \overline{YY'} are both perpendicular to \ell, so they are parallel to each other by the companion result above.

Now draw the diagonal \overline{XY'} and compare \triangle XX'Y' with \triangle Y'YX in Figure 6.

  • They share the side \overline{XY'}.
  • \angle X'Y'X \cong \angle YXY' (single arcs). These are alternate interior angles for the parallel lines \ell and m cut by the diagonal.
  • \angle X'XY' \cong \angle YY'X (double arcs). These are alternate interior angles for the parallel lines XX' and YY' cut by the same diagonal.

Two angles and the side between them match, so the triangles are congruent by ASA (the congruence criteria). Their matching sides are equal, and \overline{XX'} matches \overline{Y'Y}:

XX' = YY'

So any two points of m are the same distance from \ell. By the perpendicular transversal theorem each drop is square to both lines, so XX' is also the distance from X' back to m, and every point of \ell is that same distance from m.

The square drop is shortest. A segment from X on m to Z on \ell runs from the point X to the line \ell, so XZ \geq XX' = d because the perpendicular is shortest, with equality only when Z = X'.

The slope formula

In Figure 7, A is on \ell: y = kx + b_1 and B is directly below it on m: y = kx + b_2, so they share an x-coordinate x_0. The vertical gap is

AB = |(kx_0 + b_1) - (kx_0 + b_2)| = |b_1 - b_2|
\theta
\theta
|b_1 - b_2|
d
1
k
\displaystyle \sqrt{1+k^2}
A
B
F
\ell
m
Figure 7The vertical gap and the square gap make a right triangle similar to the slope triangle.

The drop \overline{AF} is square to m, so \triangle ABF has a right angle at F. Let \theta be the angle the lines make with the horizontal. At B, line m splits the right angle between horizontal and vertical into \theta and \angle ABF, so m\angle ABF = 90^\circ - \theta, and the angle sum of \triangle ABF leaves m\angle BAF = \theta.

The dashed slope triangle has run 1, rise k, a right angle between them, and angle \theta at the start of the run; its hypotenuse along \ell is \displaystyle \sqrt{1 + k^2} by the Pythagorean theorem. The two right triangles share the angle \theta, so they are similar by AA similarity, and the side next to \theta over the hypotenuse is the same fraction in both:

\begin{aligned} \frac{d}{|b_1 - b_2|} &= \frac{1}{\sqrt{1 + k^2}} \\[4pt] d &= \frac{|b_1 - b_2|}{\sqrt{1 + k^2}} \end{aligned}

For a line falling to the right the picture is a mirror image, and k^2 is the same, so the formula holds for every slope. With k = 0 it gives |b_1 - b_2|, the horizontal case.

The standard-form version. If b \neq 0, solve ax + by = c for y to get \displaystyle y = -\frac{a}{b}x + \frac{c}{b}. Put \displaystyle k = -\frac{a}{b}, \displaystyle b_1 = \frac{c_1}{b} and \displaystyle b_2 = \frac{c_2}{b} into the slope formula:

\begin{aligned} d &= \frac{|c_1 - c_2| / |b|}{\sqrt{1 + a^2/b^2}} \\[4pt] &= \frac{|c_1 - c_2| / |b|}{\sqrt{a^2 + b^2}/|b|} \\[4pt] &= \frac{|c_1 - c_2|}{\sqrt{a^2 + b^2}} \end{aligned}

If b = 0 the lines are the vertical lines \displaystyle x = \frac{c_1}{a} and \displaystyle x = \frac{c_2}{a}, which are \displaystyle \frac{|c_1 - c_2|}{|a|} apart, and the formula gives that too.

Worked examples

Example 1

Finding the distance in a right triangle

In Figure 8, \overline{PQ} \perp \ell, PQ = 6 and QX = 8. Find PX, and state the distance from P to \ell.

P Q X 6 8
\ell
Figure 8\overline{PQ} \perp \ell, PQ = 6 and QX = 8.
Solution

The right angle at Q makes \triangle PQX a right triangle with \overline{PX} as its longest side, so the Pythagorean theorem gives

\begin{aligned} PX^2 &= 6^2 + 8^2 = 36 + 64 = 100 \\ PX &= 10 \end{aligned}

The distance from P to \ell is measured along the perpendicular, so it is PQ = 6, not 10. The slanted \overline{PX} is longer, as the perpendicular-is-shortest result says it must be.

Example 2

Horizontal and vertical lines

Find (a) the distance from A(3, 7) to the line y = 2, and from A to the line x = -4; (b) the distance from B(3, -1) to the line y = 2; (c) the distance between the lines y = -2 and y = 5, and between the lines x = -3 and x = 4.5.

Solution

(a) The line y = 2 is horizontal, so the perpendicular through A is vertical, the foot is (3, 2), and the distance is the difference in y:

|7 - 2| = 5

The line x = -4 is vertical, so the perpendicular through A is horizontal, the foot is (-4, 7), and the distance is the difference in x:

|3 - (-4)| = 7

(b) B lies below y = 2, so its foot (3, 2) is above it. The absolute value makes the order of subtraction not matter:

|{-1} - 2| = 3

(c) Both lines y = -2 and y = 5 are horizontal, so they are parallel, and a vertical segment is square to both. The vertical segment from (0, -2) to (0, 5) has length

|5 - (-2)| = 7

The lines x = -3 and x = 4.5 are vertical, and a horizontal segment is square to both. From (-3, 0) to (4.5, 0) the length is

|4.5 - (-3)| = 7.5

Any other vertical segment between the first pair, or horizontal one between the second, gives the same answer, as the constant-distance result promises.

Example 3

Which segment is the distance?

In Figure 9, \ell \parallel m and \overline{PQ} \perp m. Also PA = 15, PB = 13 and QB = 5. Find the distance from P to m, which is also the distance between the lines, and find AQ.

15
13
5
P
Q
A
B
\ell
m
Figure 9Three segments join P to m. Only one of them measures the distance.
Solution

Of the three segments from P to m, only \overline{PQ} is perpendicular to m, so the distance from P to m is PQ. Since every point of \ell is that same distance from m, it is also the distance between the lines.

\triangle PQB has a right angle at Q, with \overline{PB} as its longest side, so by the Pythagorean theorem

\begin{aligned} PQ^2 + 5^2 &= 13^2 \\ PQ^2 &= 169 - 25 = 144 \\ PQ &= 12 \end{aligned}

\triangle PQA also has a right angle at Q, with hypotenuse PA = 15:

\begin{aligned} AQ^2 &= 15^2 - 12^2 = 225 - 144 = 81 \\ AQ &= 9 \end{aligned}

The distance is 12 and AQ = 9. Both slanted segments, 15 and 13, are longer than 12, as the perpendicular-is-shortest result says they must be. The distance is never one of the slanted lengths, however easy they are to measure.

Example 4

Checking that the foot is the closest point

P is the point (2, 5) and \ell is the line y = 1. Write the square of the distance from P to a point X(x, 1) on \ell, and find the x that makes it smallest.

Solution

The distance formula gives

\begin{aligned} PX^2 &= (x - 2)^2 + (1 - 5)^2 \\ &= (x - 2)^2 + 16 \end{aligned}

A square is never negative, so (x - 2)^2 \ge 0, with 0 only when x = 2. The smallest value of PX^2 is therefore 16, reached at x = 2, and the smallest PX is \displaystyle \sqrt{16} = 4.

The closest point is X(2, 1), straight below P: the foot of the perpendicular, with 4 = |5 - 1|. The algebra found the right angle without being told to look for one.

Example 5

A slanted line

Find the distance from P(5, 0) to the line y = 2x.

O P Q
y = 2x
x
y
Figure 10The shortest way from P(5, 0) to the line y = 2x ends at Q(1, 2), not at the origin.
Solution

The distance is measured to the foot, so find the foot first. The line y = 2x has slope 2, so a line perpendicular to it has slope \displaystyle -\frac{1}{2}, since slopes of perpendicular lines multiply to -1. The perpendicular through P is

y = -\tfrac{1}{2}(x - 5)

The foot Q lies on both lines, so set the two expressions for y equal:

\begin{aligned} 2x &= -\tfrac{1}{2}x + \tfrac{5}{2} \\ 4x &= -x + 5 \\ x &= 1 \end{aligned}

and then y = 2(1) = 2, so Q = (1, 2). The distance is the length PQ:

\begin{aligned} PQ &= \sqrt{(5 - 1)^2 + (0 - 2)^2} \\ &= \sqrt{16 + 4} = \sqrt{20} \\ &= 2\sqrt{5} \approx 4.47 \end{aligned}

Check. The origin is also on the line, and PO = 5. That is longer than \displaystyle 2\sqrt{5}, as it has to be, since O is not the foot.

Example 6

The height of a right triangle

In Figure 11, \triangle ABC has a right angle at C, with CA = 6, CB = 8 and AB = 10. Find the distance from C to the line AB.

A B C D 6 8
h
10
Figure 11CA = 6, CB = 8 and AB = 10. The distance from C to the line AB is the height h.
Solution

The distance from C to line AB is CD, which is also the height of the triangle when \overline{AB} is the base. So the area can be written two ways. With the legs as base and height, since they meet at a right angle:

\text{Area} = \tfrac{1}{2}(6)(8) = 24

With \overline{AB} as the base and h = CD as the height:

\text{Area} = \tfrac{1}{2}(10)h = 5h

Both describe the same triangle, so 5h = 24 and

h = \frac{24}{5} = 4.8

Check. 4.8 is shorter than both CA = 6 and CB = 8, which are also segments from C to the line AB.

Example 7

Right angles carried across

In Figure 3, \ell \parallel m and t \perp \ell. (a) How many of the eight angles at the two crossings are right angles, and why? (b) Where t crosses m, one angle measures (3x + 15)^\circ and an angle next to it measures (2y - 10)^\circ. Find x and y.

Solution

(a) At the crossing with \ell, one angle is a right angle because t \perp \ell. The angle opposite it is vertical to it, so it is 90^\circ. Each of the other two forms a linear pair with it, so each is 180^\circ - 90^\circ = 90^\circ. That is four right angles.

At the crossing with m, the perpendicular transversal theorem gives t \perp m, since \ell \parallel m. The same argument gives four more. All 8 angles are right angles.

(b) By part (a) every angle at the crossing with m is 90^\circ, so each expression equals 90:

\begin{aligned} 3x + 15 &= 90 & \qquad 2y - 10 &= 90 \\ 3x &= 75 & 2y &= 100 \\ x &= 25 & y &= 50 \end{aligned}

Check. 3(25) + 15 = 90 and 2(50) - 10 = 90.

Example 8

Deciding whether the transversal is perpendicular

\ell \parallel m, and t crosses both. At the crossing with \ell, one angle measures (2x + 40)^\circ and the angle vertical to it measures (5x - 50)^\circ. Is t perpendicular to m? Find the four angles at the crossing with m.

Solution

Vertical angles are equal, so

\begin{aligned} 2x + 40 &= 5x - 50 \\ 90 &= 3x \\ x &= 30 \end{aligned}

Each of that pair measures (2(30) + 40)^\circ = 100^\circ. That is not 90^\circ, so t is not perpendicular to \ell, and the theorem says nothing.

Corresponding angles still work, though, because \ell \parallel m. The angle at m in the same position as the 100^\circ angle is also 100^\circ, its vertical partner is 100^\circ, and the other two are 180^\circ - 100^\circ = 80^\circ. The four angles at m are 100^\circ, 80^\circ, 100^\circ and 80^\circ, and t is not perpendicular to m. Whatever slant the transversal has at one parallel line, it has at the other; the theorem is the case where that slant is 90^\circ.

Example 9

A triangle between the parallels

In Figure 12, \ell \parallel m and t \perp \ell. A line s runs from P to a point B on m, and the angle between t and s at P is 35^\circ. Find x.

35^\circ
x
\ell
m
t
s
P
Q
B
Figure 12\ell \parallel m and t \perp \ell. Find x.
Solution

The figure marks only one right angle, at P. The one that matters is at Q. Since \ell \parallel m and t \perp \ell, the theorem gives t \perp m, so m\angle PQB = 90^\circ.

Now \triangle PQB has angles 35^\circ at P, 90^\circ at Q, and x at B. The angles of a triangle add to 180^\circ:

35^\circ + 90^\circ + x = 180^\circ \qquad\Longrightarrow\qquad x = 55^\circ

Check by a different route. At P, the angle between s and the left-hand part of \ell is 90^\circ - 35^\circ = 55^\circ, because together with the 35^\circ angle it fills the right angle between t and \ell on that side. That angle and x are alternate interior angles for the transversal s, so they are equal. Both routes give 55^\circ.

Example 10

A quadrilateral with one square corner

In quadrilateral ABCD, \overline{AB} \parallel \overline{DC} and \overline{AD} \perp \overline{AB}, with m\angle B = 64^\circ. Find m\angle C and m\angle D.

Solution

Side \overline{AD} lies on a transversal of the parallel lines AB and DC, and it is perpendicular to AB. By the theorem it is perpendicular to DC as well, so

m\angle D = 90^\circ

Side \overline{BC} lies on another transversal of the same two parallel lines. \angle B and \angle C are both between the parallels and on the same side of it, so they are same-side interior angles, which add to 180^\circ:

m\angle C = 180^\circ - 64^\circ = 116^\circ

Check. The angles of a quadrilateral add to 360^\circ: 90 + 64 + 116 + 90 = 360.

If \angle B were a right angle as well, the same reasoning would make \angle C one too, and ABCD would have four right angles. That is the route into rectangles.

Example 11

A chain of perpendiculars

In a plane, lines a and b are different lines, both perpendicular to line c. Line d is perpendicular to a. Show that d \perp b and that d is parallel to c or equal to it.

Solution

Since a \perp c and b \perp c, and a and b are different lines, the companion result gives a \parallel b.

Now d \perp a and a \parallel b, so by the perpendicular transversal theorem, d \perp b.

Finally, d and c are both perpendicular to a. If they are different lines, the companion result makes them parallel. They could also be the same line, if d happens to cross a at the same point c does, since only one line through a point is perpendicular to a.

Every step here is one of the two results, used in the direction it points. Long chains of perpendicular and parallel lines, like the grid lines on graph paper, are built this way.

Example 12

Dropping a perpendicular between parallel lines

The lines \ell: y = 2x + 4 and m: y = 2x - 6 are parallel, since both have slope 2. Find the distance between them by dropping a perpendicular from A(0, 4), then again from C(2, 8), and compare.

A
B
C
D
\ell
m
x
y
Figure 13Two drops from \ell to m, started at different points, land at the same length.
Solution

A line square to \ell has slope \displaystyle -\frac{1}{2}, because perpendicular slopes multiply to -1. Through A(0, 4) that line is \displaystyle y = -\frac{1}{2}x + 4. It meets m where the y values agree:

\begin{aligned} 2x - 6 &= -\tfrac{1}{2}x + 4 \\ \tfrac{5}{2}x &= 10 \\ x &= 4 \end{aligned}

and y = 2(4) - 6 = 2, so the foot is B(4, 2). The perpendicular transversal theorem promises that this line is square to m too, and the slopes confirm it: m also has slope 2, and \displaystyle 2 \cdot \left(-\frac{1}{2}\right) = -1. By the distance formula,

AB = \sqrt{(4 - 0)^2 + (2 - 4)^2} = \sqrt{20} = 2\sqrt{5}

From C(2, 8), the perpendicular is \displaystyle y = -\frac{1}{2}x + 9. Setting \displaystyle 2x - 6 = -\frac{1}{2}x + 9 gives \displaystyle \frac{5}{2}x = 15, so x = 6 and y = 6: the foot is D(6, 6), and

CD = \sqrt{(6 - 2)^2 + (6 - 8)^2} = \sqrt{20} = 2\sqrt{5}

The two drops agree, as the constant-distance result promises. The distance is \displaystyle 2\sqrt{5} \approx 4.47.

Check with the slope formula: \displaystyle \dfrac{|4 - (-6)|}{\sqrt{1 + 2^2}} = \dfrac{10}{\sqrt{5}} = 2\sqrt{5}.

Example 13

Using the formula, two ways

Find the distance between \displaystyle y = \frac{3}{4}x + 2 and \displaystyle y = \frac{3}{4}x - 8.

Solution

Both lines have slope \displaystyle k = \frac{3}{4}, so they are parallel, and the slope formula applies with b_1 = 2 and b_2 = -8:

\begin{aligned} d &= \frac{|2 - (-8)|}{\sqrt{1 + \left(\frac{3}{4}\right)^2}} = \frac{10}{\sqrt{\frac{25}{16}}} \\[4pt] &= \frac{10}{\frac{5}{4}} = 8 \end{aligned}

Check with the standard form. Multiply each equation by 4 and gather the x and y terms on the left: the first becomes 3x - 4y = -8 and the second 3x - 4y = 32. The coefficients match, so

d = \frac{|-8 - 32|}{\sqrt{3^2 + (-4)^2}} = \frac{40}{5} = 8

The distance is 8, less than the vertical gap of 10, because the lines are tilted.

Example 14

The height of a parallelogram

A parallelogram has two opposite sides on the lines y = x + 1 and y = x - 5. The side on y = x + 1 has length \displaystyle 4\sqrt{2}. Find the area of the parallelogram.

Solution

The area of a parallelogram is base times height, and the height is the distance between the two lines holding the base and the opposite side.

Both lines have slope 1, with b_1 = 1 and b_2 = -5:

d = \frac{|1 - (-5)|}{\sqrt{1 + 1^2}} = \frac{6}{\sqrt{2}} = 3\sqrt{2}

So the area is

4\sqrt{2} \cdot 3\sqrt{2} = 12 \cdot 2 = 24

Nothing here needed the corners of the parallelogram: wherever the base sits along its line, the opposite side is the same distance away.

Example 15

Lines at a given distance

Find every line parallel to y = 2x + 1 that is \displaystyle \sqrt{5} away from it.

Solution

A line parallel to y = 2x + 1 has slope 2, so it is y = 2x + b for some b. The slope formula says its distance from y = 2x + 1 is

\frac{|b - 1|}{\sqrt{1 + 2^2}} = \frac{|b - 1|}{\sqrt{5}}

Set that equal to \displaystyle \sqrt{5} and multiply both sides by \displaystyle \sqrt{5}:

|b - 1| = 5

which means b - 1 = 5 or b - 1 = -5, so b = 6 or b = -4. There are two lines, y = 2x + 6 and y = 2x - 4, one on each side.

Check. The perpendicular from (0, 1), \displaystyle y = -\frac{1}{2}x + 1, meets y = 2x + 6 where \displaystyle 2x + 6 = -\frac{1}{2}x + 1, at (-2, 2), and that point is \displaystyle \sqrt{4 + 1} = \sqrt{5} from (0, 1).

Boundaries

It is the distance to a whole line, not a segment. A line runs forever, so the foot is always somewhere on it. A segment stops. If the foot of the perpendicular from P lands beyond the end of a segment, the closest point of the segment is its nearer endpoint, and the perpendicular length is no longer the answer.

It is measured straight. The results are about straight-line length in a flat plane. A path that has to follow streets on a grid, or stay on the surface of a globe, is measured differently, and the shortest route need not meet the line square.

The lines must be parallel. Two lines that cross are close together near the crossing and far apart away from it, so no single number describes the gap. Nor does a right angle carry across: in Figure 14, t \perp \ell, but m is tilted toward \ell, and t meets it at 70^\circ.

70^\circ
\ell
m
t
Figure 14Without parallel lines the right angle does not carry over.

Nearly perpendicular carries over exactly, not as a right angle. If t meets one of two parallel lines at 89^\circ, it meets the other at 89^\circ. The perpendicular transversal theorem is the 90^\circ case of corresponding angles, not a rounding rule.

The companion needs two different points. If a \perp t and b \perp t at the same point of t, then a and b are the same line, since through a point on a line there is exactly one perpendicular to it in a plane.

The formulas need matching equations. The slope formula needs both lines written with the same slope k, and it cannot be used for vertical lines, which have no slope; use |p - q| or the standard form for those. The standard-form formula needs the same a and the same b in both equations, not just proportional ones: 2x + y = 3 and 4x + 2y = 16 are parallel, but the second must be divided by 2 before the formula is used. If the two equations describe the same line, either formula gives 0.

In space. A point P off \ell and the line \ell lie in exactly one plane, and inside it both proofs of the perpendicular-is-shortest result work unchanged. Two parallel lines in space also lie in one plane, so their distance is unchanged too. But the perpendicular transversal theorem and its companion both fail in space. Take a box. The top front edge and the bottom back edge are parallel, and the upright front left edge is perpendicular to the top front edge, yet it never meets the bottom back edge at all; lines like that, which never meet and are not parallel, are skew, and the gap between them is not constant. And at any corner of the box, the two edges running along the floor are both perpendicular to the upright edge, but they meet each other, so they are not parallel.

It depends on the parallel postulate. The perpendicular transversal theorem and the rectangle argument both use the parallel postulate, through corresponding and alternate interior angles. In the hyperbolic plane, where that postulate fails, a line perpendicular to one of two parallel lines can miss the other or cross it at a slant, the gap between two lines that never meet is never constant, and the points at a fixed distance from a line do not form a line. The companion result does not use the postulate and still holds there, and so does the perpendicular-is-shortest result.

Where this goes next

Every height in geometry is a distance from a point to a line. The height in an area formula is the distance from the top vertex to the line of the base, and an altitude is the segment that realizes it, as Example 6 used. In a parallelogram or a trapezoid the height is the distance between the parallel sides, which is why it is measured square across, never along a slanted side, and why the area formulas can use any convenient base point. In a quadrilateral with two pairs of parallel sides, the perpendicular transversal theorem turns one right angle into four, and the shape is a rectangle.

Turned around, the results describe sets of points. Everything at distance d from a line lies on one of two lines parallel to it, one on each side, as Example 15 found. Sets described by a distance condition are the subject of loci.

Several theorems are statements about this distance. A point lies on an angle’s bisector exactly when it is equally far from the two sides, the angle bisector distance theorem. A line touches a circle exactly when its distance from the center equals the radius, which is why a tangent is perpendicular to the radius. And chords of a circle that are the same distance from the center are the same length.

In coordinates the perpendicular transversal theorem becomes a fact about slopes: parallel lines share a slope, so the perpendicular slope is the same for both. That is what you use to write a line parallel or perpendicular to a given one, including parallel lines a chosen distance apart. And the steps of Example 5 can be done once with letters instead of numbers. The result, stated here without proof, is a single formula: if a and b are not both zero, the distance from (x_0, y_0) to the line ax + by + c = 0 is

\frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}

For Example 5, y = 2x is 2x - y = 0, and the formula gives \displaystyle 10 / \sqrt{5} = 2\sqrt{5}, as found there.

Exercises

The perpendicular is shortest

  1. Three segments join P to line \ell, with lengths 10, 6 and 7.5. One of them is perpendicular to \ell. Which one, and how far from its foot does each of the other two end?
  2. P is 8 units from line \ell. Which of these could be the length of a segment from P to a point of \ell: 5, 8, 8.5, 20? Explain.
  3. A swimmer is 40 m from a straight shoreline. She swims in a straight line to a point on the shore 30 m from the nearest point of the shore. How far does she swim, and how much further is that than the shortest possible swim?
  4. P is 15 units from line \ell. How many points of \ell are exactly 17 units from P, and how far apart are they?

On the coordinate plane

  1. Find the distance from (4, -3) to the line y = 5.
  2. Find the distance from (-6, 2) to the line x = 1.
  3. Find the distance from (-2, -9) to the x-axis and to the y-axis.
  4. Find the distance from (6, -1) to the line y = -4 and to the line x = 6.
  5. Find the distance from the origin to the line x + y = 4.
  6. Find the foot of the perpendicular from (10, 0) to the line y = 3x, and the distance.

Distances inside figures

  1. A right triangle has legs 5 and 12. Find the distance from the right-angle vertex to the line containing the hypotenuse.
  2. A triangle has sides 13, 13 and 10. Find the distance from the vertex between the two equal sides to the line containing the third side.

Right angles across parallel lines

  1. \ell \parallel m, and t crosses both with t \perp m. How many of the eight angles at the two crossings are right angles?
  2. \ell \parallel m, and t crosses \ell making an 88^\circ angle. Is t \perp m? Find the four angles where t crosses m.
  3. \ell \parallel m and t \perp \ell. One of the angles where t crosses m measures (x^2 - 54)^\circ. Find every value of x that works.
  4. \ell \parallel m and t \perp \ell. At the crossing with m, two neighboring angles measure (6x)^\circ and (2y + 10)^\circ. Find x and y.
  5. \ell \parallel m, and t crosses both. At the crossing with \ell, two neighboring angles measure (3x + 12)^\circ and (4x - 14)^\circ. Find x, and decide whether t \perp m.
  1. In the set-up of Figure 12, \ell \parallel m, t \perp \ell at P, t meets m at Q, and s joins P to B on m. If x = 50^\circ, find the angle between t and s at P.
  2. In the same set-up, the angle between t and s at P is (2k)^\circ and x = (3k + 10)^\circ. Find k and both angles.
  3. In quadrilateral ABCD, \overline{AB} \parallel \overline{DC} and \overline{AD} \perp \overline{DC}, with m\angle C = 125^\circ. Find m\angle A and m\angle B.
  4. In a plane, a \parallel b, b \parallel c and t \perp a. What is the relationship between t and c? Explain.
  5. In a plane, p, q, r and s are four different lines with p \perp q, q \perp r and r \perp s. What is the relationship between p and r, and between p and s? Explain.

The distance between parallel lines

  1. Find the distance between the lines y = 3 and y = -4, and between the lines x = -6 and x = 2.
  2. The line \ell passes through (3, -2) and is parallel to the line x = 7. Find the distance between \ell and x = 7.
  3. Find both horizontal lines that are 5 away from y = 2.
  4. \ell \parallel m. P is on \ell, Q is the foot of the perpendicular from P to m, and A is a point of m with PA = 25 and AQ = 7. A point R on \ell is 40 units from P. Find the distance from R to m.
  5. Find the distance between \displaystyle y = -\frac{4}{3}x + 5 and \displaystyle y = -\frac{4}{3}x - 5.
  6. Find the distance between 3x + 4y = 12 and 3x + 4y = -8.
  7. Find the distance between 2x + y = 3 and 4x + 2y = 16.
  8. Find the distance between y = -2x + 1 and y = -2x + 11 by dropping a perpendicular from (0, 1), as in Example 12. Then check with the slope formula.
  9. Find every value of b for which y = 2x + b is \displaystyle 2\sqrt{5} away from y = 2x + 1.
  10. A parallelogram has two opposite sides on y = 3 and y = -1, and each of those sides has length 7. Find its area.
  11. A parallelogram has two opposite sides on 3x - 4y = 2 and 3x - 4y = 17, and each of those sides has length 6. Find its area.
  12. A trapezoid has its parallel sides on y = x and y = x + 8, with lengths \displaystyle 3\sqrt{2} and \displaystyle 5\sqrt{2}. Find its area.
  13. Find the line parallel to y = 2x + 4 and y = 2x - 6 that lies midway between them, and its distance from each.

Reasoning

  1. Explain why the distance from P to \ell is 0 exactly when P lies on \ell.
  2. Someone measures from a point to a line along a segment that meets the line at 60^\circ, and gets 10. Is the distance from the point to the line more than 10, less, or equal? Explain.
  3. P is at distance d from \ell. X and Y are points of \ell with QX < QY, where Q is the foot. Explain why PX < PY.
  4. Points V, X and W lie on a line in that order, with X between V and W. Show that for every point P, either PX < PV or PX < PW.
  5. \ell \parallel m and the distance between them is 4. Can a segment with one end on \ell and the other on m have length 3? Length 10? Explain.
  6. Someone uses the standard-form formula directly on 2x + y = 3 and 4x + 2y = 16 and gets \displaystyle \frac{13}{\sqrt{20}}. Explain what went wrong.
  7. In Figure 14, t \perp \ell but t is not perpendicular to m. Explain why this does not contradict the perpendicular transversal theorem.
  8. \ell \parallel m in a plane, and t crosses \ell. Explain why t must also cross m.
  9. Prove the companion result a second way: if a \perp t and b \perp t at different points, use same-side interior angles to show a \parallel b.
  10. In the coordinate plane, \ell and m are parallel lines with slope k \neq 0, and t is perpendicular to \ell. Use slopes to explain why t is perpendicular to m.
  11. Use the edges of a box to show that in space, two lines perpendicular to the same line need not be parallel.
  12. Two different lines \ell and m lie in a plane, and every point of m is the same distance from \ell. Show that m \parallel \ell.
Answers
  1. The segment of length 6 is the perpendicular, since the perpendicular is the shortest. The others end 8 and 4.5 from the foot: \displaystyle \sqrt{10^2 - 6^2} = \sqrt{64} = 8 and \displaystyle \sqrt{7.5^2 - 6^2} = \sqrt{20.25} = 4.5.
  2. 8, 8.5 and 20 can; 5 cannot. Every segment from P to \ell is at least as long as the perpendicular, 8, and only the perpendicular itself has length exactly 8. Each length above 8 occurs twice, once on each side of the foot.
  3. She swims 50 m, which is 10 m further than the shortest swim. The shortest swim is the perpendicular, 40 m; her swim is \displaystyle \sqrt{40^2 + 30^2} = \sqrt{2500} = 50.
  4. Two points, 16 units apart. A point t from the foot is \displaystyle \sqrt{225 + t^2} from P, and 225 + t^2 = 289 gives t = 8, on each side of the foot.
  5. 8. The line is horizontal, so the distance is |{-3} - 5| = 8.
  6. 7. The line is vertical, so the distance is |{-6} - 1| = 7.
  7. 9 to the x-axis and 2 to the y-axis. The x-axis is y = 0, giving |{-9} - 0| = 9; the y-axis is x = 0, giving |{-2} - 0| = 2.
  8. 3 to y = -4, and 0 to x = 6. |{-1} - (-4)| = 3, and the point has x = 6, so it lies on the second line.
  9. \displaystyle 2\sqrt{2}. The line y = -x + 4 has slope -1, so the perpendicular through the origin is y = x. They meet where x = -x + 4, at (2, 2), and \displaystyle \sqrt{2^2 + 2^2} = \sqrt{8} = 2\sqrt{2}.
  10. The foot is (1, 3) and the distance is \displaystyle 3\sqrt{10}. The perpendicular has slope \displaystyle -\frac{1}{3}: \displaystyle y = -\frac{1}{3}(x - 10). Setting \displaystyle 3x = -\frac{1}{3}(x - 10) gives 9x = -x + 10, so x = 1. Then \displaystyle \sqrt{9^2 + 3^2} = \sqrt{90} = 3\sqrt{10}.
  11. The distance is \displaystyle \frac{60}{13} \approx 4.62. The hypotenuse is \displaystyle \sqrt{25 + 144} = 13. The area is \displaystyle \frac{1}{2}(5)(12) = 30 and also \displaystyle \frac{1}{2}(13)h, so \displaystyle h = \frac{60}{13}.
  12. 12. The two equal sides make the foot land at the midpoint of the side of length 10, so h^2 = 13^2 - 5^2 = 144.
  13. All 8. The theorem applies with the roles of \ell and m swapped, so t \perp \ell as well, and each crossing has four right angles.
  14. No. The corresponding angle at m is also 88^\circ, so the four angles at m are 88^\circ, 92^\circ, 88^\circ, 92^\circ. None is a right angle.
  15. x = 12 or x = -12. The theorem gives t \perp m, so x^2 - 54 = 90 and x^2 = 144. Both values give an angle of 90^\circ, which is all that is needed.
  16. x = 15 and y = 40. The theorem gives t \perp m, so every angle at m is 90^\circ: 6x = 90 and 2y + 10 = 90.
  17. x = 26, and yes, t \perp m. Neighboring angles form a linear pair, so (3x + 12) + (4x - 14) = 180, giving 7x = 182. Then both angles are 90^\circ, so t \perp \ell, and the theorem gives t \perp m.
  18. 40^\circ. The angle at Q is 90^\circ by the theorem, so the angle at P is 180^\circ - 90^\circ - 50^\circ = 40^\circ.
  19. k = 16, the angle at P is 32^\circ and x = 58^\circ. The angle at Q is 90^\circ by the theorem, and the triangle’s angles add to 180^\circ: 2k + 90 + (3k + 10) = 180, so 5k = 80.
  20. m\angle A = 90^\circ and m\angle B = 55^\circ. \overline{AD} lies on a transversal of the parallel lines and is perpendicular to DC, so it is perpendicular to AB as well. \angle B and \angle C are same-side interior angles along \overline{BC}, so m\angle B = 180^\circ - 125^\circ.
  21. t \perp c. Since t \perp a and a \parallel b, the perpendicular transversal theorem gives t \perp b. Since b \parallel c, it applies again and gives t \perp c.
  22. p \parallel r and p \perp s. p and r are different lines both perpendicular to q, so they are parallel by the companion result. Then s \perp r and r \parallel p, so the perpendicular transversal theorem gives s \perp p.
  23. 7 and 8. The first pair is horizontal, so the distance is |3 - (-4)| = 7; the second is vertical, so it is |2 - (-6)| = 8.
  24. 4. A line through (3, -2) parallel to x = 7 is vertical, so it is x = 3, and |7 - 3| = 4.
  25. y = 7 and y = -3. A horizontal line y = q is |q - 2| from y = 2, and |q - 2| = 5 gives q = 7 or q = -3.
  26. 24. \triangle PQA has a right angle at Q, so \displaystyle PQ = \sqrt{25^2 - 7^2} = \sqrt{576} = 24, the distance between the lines. Every point of \ell is that same distance from m, so R is 24 from m; the 40 does not matter.
  27. 6. With \displaystyle k = -\frac{4}{3}, \displaystyle \sqrt{1 + \frac{16}{9}} = \frac{5}{3}, so \displaystyle d = \frac{|5 - (-5)|}{5/3} = 10 \cdot \frac{3}{5} = 6.
  28. 4. The equations match, so \displaystyle d = \frac{|12 - (-8)|}{\sqrt{3^2 + 4^2}} = \frac{20}{5} = 4.
  29. \displaystyle \sqrt{5}. Divide the second equation by 2 to get 2x + y = 8, so the equations match. Then \displaystyle d = \frac{|3 - 8|}{\sqrt{2^2 + 1^2}} = \frac{5}{\sqrt{5}} = \sqrt{5}.
  30. \displaystyle 2\sqrt{5}. The perpendicular through (0, 1) has slope \displaystyle \frac{1}{2}: \displaystyle y = \frac{1}{2}x + 1. Setting \displaystyle -2x + 11 = \frac{1}{2}x + 1 gives \displaystyle \frac{5}{2}x = 10, so x = 4, y = 3. The distance from (0, 1) to (4, 3) is \displaystyle \sqrt{16 + 4} = \sqrt{20} = 2\sqrt{5}. Check: \displaystyle \frac{|1 - 11|}{\sqrt{1 + 4}} = \frac{10}{\sqrt{5}} = 2\sqrt{5}.
  31. b = 11 or b = -9. From \displaystyle \frac{|b - 1|}{\sqrt{5}} = 2\sqrt{5}, |b - 1| = 10.
  32. 28. The height is the distance between the lines, |3 - (-1)| = 4, and the area is 7 \cdot 4 = 28.
  33. 18. The height is \displaystyle \frac{|2 - 17|}{\sqrt{3^2 + (-4)^2}} = \frac{15}{5} = 3, and the area is 6 \cdot 3 = 18.
  34. 32. The height is \displaystyle \frac{|0 - 8|}{\sqrt{2}} = 4\sqrt{2}, so the area is \displaystyle \frac{3\sqrt{2} + 5\sqrt{2}}{2} \cdot 4\sqrt{2} = 4\sqrt{2} \cdot 4\sqrt{2} = 32.
  35. y = 2x - 1, at a distance of \displaystyle \sqrt{5} from each. The line y = 2x + b with b between -6 and 4 is midway when \displaystyle \frac{4 - b}{\sqrt{5}} = \frac{b + 6}{\sqrt{5}}, so b = -1. Each distance is \displaystyle \frac{5}{\sqrt{5}} = \sqrt{5}.
  36. If P is on \ell, P is its own foot and PQ = PP = 0. If P is off \ell, the foot Q is a different point from P, and two different points are a positive distance apart.
  37. Less than 10. A segment meeting the line at 60^\circ is not perpendicular, so it is not the shortest segment from the point to the line. The perpendicular is strictly shorter.
  38. With QX = s and QY = t, \displaystyle PX = \sqrt{d^2 + s^2} and \displaystyle PY = \sqrt{d^2 + t^2}. Since 0 \le s < t, s^2 < t^2, so d^2 + s^2 < d^2 + t^2, and square roots keep that order.
  39. Let Q be the foot of the perpendicular from P to the line (if P is on the line, Q = P). Q is on the line, so it is at X, or on the same side of X as V, or on the same side as W. In the first two cases X lies between Q and W or is Q, so QW = QX + XW > QX. In the third, QV = QX + XV > QX in the same way. By Exercise 38 the point further from Q is further from P, so PX < PW in the first two cases and PX < PV in the third.
  40. Not 3, but 10 is possible. Every segment joining the lines is at least as long as the square drop, 4. A slanted segment ending \displaystyle \sqrt{84} from the foot of a drop has length \displaystyle \sqrt{4^2 + 84} = \sqrt{100} = 10.
  41. The formula needs the same a and b in both equations, but the second has a = 4, b = 2, so |3 - 16| compares constants on two different scales. Dividing the second equation by 2 gives 2x + y = 8 and the correct distance \displaystyle \frac{5}{\sqrt{5}} = \sqrt{5}.
  42. The theorem assumes the two lines are parallel, and in Figure 14 they are not: m tilts toward \ell. With no parallel lines, corresponding angles need not be equal, so nothing carries the right angle from \ell to m.
  43. If t never crossed m, it would be parallel to m. Then t and \ell would be two different lines through the point where t crosses \ell, both parallel to m. The parallel postulate allows only one, so t must cross m.
  44. At P and Q, the two angles between a and b on one side of t are both 90^\circ, so they add to 180^\circ. Same-side interior angles that add to 180^\circ make the lines parallel, so a \parallel b.
  45. m has the same slope k as \ell. Since t \perp \ell, the slope of t is \displaystyle -\frac{1}{k}, and \displaystyle k \cdot \left(-\frac{1}{k}\right) = -1. The product of the slopes of t and m is also -1, so t \perp m.
  46. At one bottom corner of a box, the upright edge rises from the floor. The two floor edges leaving that corner are each perpendicular to the upright edge, but they meet each other at the corner, so they are not parallel.
  47. Suppose m were not parallel to \ell. Two different lines in a plane that are not parallel meet, say at X. Then X is on \ell, at distance 0 from it, so every point of m is at distance 0 from \ell and lies on \ell. Then m and \ell would be the same line, which they are not. So m \parallel \ell.
kg1128 · updated 2026-10-02 · CC-BY-SA-4.0