Top

# Shortest Distance Between Two Lines

In mathematics, we are often asked to find the shortest distance between two lines. When the lines are intersecting, the shortest distance between them is eventually zero. For two non-intersecting lines lying in the same plane, the shortest distance is the distance that is shortest of all the distances between two points lying on both lines. For two parallel lines, this distance would be the length of perpendicular drawn from one point on a line to the other line. In this page, we will study about the shortest distance between two parallel lines in detail.

 Related Calculators Point of Intersection of Two Lines Calculator Distance Calculator Acceleration Calculator Distance Calculating Distance Formula

## Definition

Parallel lines have uniform shortest distance between them at any point. The parallel lines are shown in the following diagram :

Finding shortest distance between two parallel lines is equal to determining how far apart they are. This can be done by measuring the length of a line that is perpendicular to both of them. We may derive a formula using this approach and use this formula directly to find the shortest distance between two parallel lines.

## Formula

Let us suppose that two parallel lines are represented in the following form :
y = mx + c$_{1}$
y = mx + c$_{2}$

(the slopes two parallel lines are equal)

Then, the formula for shortest distance can be written as under :

d = $\frac{|c_{2} - c_{1}|}{\sqrt{1 + m^{2}}}$

If the equations of two parallel lines are expressed in the following way :
ax + by + d$_{1}$ = 0
ax + by + d$_{2}$ = 0
then there is a little change in the formula.

d = $\frac{|d_{2} - d_{1}|}{\sqrt{a^{2} + b^{2}}}$

## Proof

Two given equations are
y = mx + c$_{1}$
y = mx + c$_{2}$

To find the distance between these two, we are required to calculate the difference of two intercepts of these lines through the perpendicular line given by

y = $\frac{-x}{m}$

(as slope of perpendicular line would be $\frac{-1}{m}$)

Intersecting point of the first line and perpendicular line can be found by solving following linear system

y = mx + c$_{1}$ _____(1)

y = $\frac{-x}{m}$ ____(2)

We have

$mx + c_{1}$ = $\frac{-x}{m}$

$x\ (m\ +$ $\frac{1}{m})$ = $-c_{1}$

$x$ = $\frac{-c_{1} m}{1\ +\ m^{2}}$

From equation (2)

y = $\frac{c_{1} }{1\ +\ m^{2}}$

Thus, we got $(\frac{-c_{1} m}{1\ +\ m^{2}}, \frac{c_{1} }{1\ +\ m^{2}})$ as the intersecting point of perpendicular line and first line.

Similarly, on solving y = mx + c$_{2}$ and y = $- \frac{x}{m}$, we obtain the following $(\frac{-c_{2} m}{1\ +\ m^{2}}, \frac{c_{2} }{1 + m^{2}})$.

Distance between these two points is :

$d$ = $\sqrt{(\frac{c_{1} m-c_{2} m}{1 + m^{2}})^{2} + (\frac{c_{1} -c_{2} }{1\ +\ m^{2}})^{2}}$

= $\sqrt{\frac{(c_{1} -c_{2})^{2}}{1\ +\ m^{2}}}$

= $\frac{|c_{1} -c_{2}|} {\sqrt{1\ +\ m^{2}}}$

If we perform similar process for the set of equations
ax + by + d$_{1}$ = 0
ax + by + d$_{2}$ = 0

We get the following formula

$d$ = $\frac{|d_{2} - d_{1}|}{\sqrt{a^{2} + b^{2}}}$

## Examples

The examples on shortest distance between two lines are discussed below.
Example 1 : Find the distance between two parallel lines y = x + 6  and y = x - 2.

Solution :
This is the form of y = mx + c

Here, m = 1, c$_{1}$ = 6, c$_{2}$ = -2

Formula is :

d = $\frac{|c_{2} - c_{1}|}{\sqrt{1 + m^{2}}}$

d = $\frac{|-2 - 6|}{\sqrt{1 + 1^{2}}}$

d = $\frac{8}{\sqrt{2}}$ = 5.657 units
Example 2 : Calculate the distance between parallel lines 15x + 8y - 34 = 0 and 15x + 8y + 31 = 0.

Solution : a = 15, b = 8,
d$_{1}$ = -34, d$_{2}$ = 31

The formula is given by :

d = $\frac{|d_{2} - d_{1}|}{\sqrt{a^{2} + b^{2}}}$

d = $\frac{|31 + 34|}{\sqrt{15^{2} + 8^{2}}}$

d = $\frac{|65|}{\sqrt{225 + 64}}$

d = $\frac{65}{\sqrt{289}}$

d = $\frac{65}{17}$ = 3.82 units
 More topics in Shortest Distance Between Two Lines Distance From a Point to a Line
 NCERT Solutions NCERT Solutions NCERT Solutions CLASS 6 NCERT Solutions CLASS 7 NCERT Solutions CLASS 8 NCERT Solutions CLASS 9 NCERT Solutions CLASS 10 NCERT Solutions CLASS 11 NCERT Solutions CLASS 12
 Related Topics Math Help Online Online Math Tutor
*AP and SAT are registered trademarks of the College Board.