Search 75,700 tutors
FIND TUTORS

How to find a distance between two parallel lines?

Suppose, one have two parallel lines given by the equations:
 
y=mx+b1 and y=mx+b2. Remember, if the lines are parallel, their slopes must be the same, so m is the same for two lines, hence no subscript for m. How would one approach the problem of finding the distance between those lines?
 
First, if one draws a picture, he or she shall immediately realize that if a point  is A chosen on one of the lines, with coordinates (x1, y1), and a perpendicular line is drawn from that point to the second line, the length of the segment of this new line between two parallel lines give us the sought distance. Let us denote the point of intersection of our perpendicular line with the second line as B(x2,y2).
 
What do we know of point A and B?
 
First, since A lies on the first parallel line, its coordinates must satisfy the equation for the first line, that is,
 
y1=mx1+b1       (1)
 
Same is true for B and the second line. So we can write:
 
y2=mx2+b2       (2)
 
We also know that line AB is perpendicular to both parallel lines. It is a known fact that the slope of the line, which is perpendicular to the given line, is inverse reciprocal of the slope of that line. So the line AB MUST have the slope equal to -1/m. The slope of the line connecting two points, A and B, is given by:
 
slope=(y2-y1)/(x2-x1). In this case it is -1/m. So we obtain:
 
(y2-y1)/(x2-x1)=-1/m           (3)
 
The distance between two points, A and B, is given by:
 
d=√[(y2-y1)2+(x2-x1)2]        (4)
 
From equations (1) and (2) we obtain:
 
(y2-y1)=m(x2-x1)+(b2-b1)    (5)
 
Plug in (y2-y1) from eq. (5) into eq. (3) and solve for (x2-x1). We obtain upon solving:
 
(x2-x1)=m(b2-b1)/(m2+1);   (6)
 
 
Substituting (6) into (3) immediately yields the following:
 
(y2-y1)=-(b2-b1)/(m2+1)      (7)
 
Now final step is to plug eq. (6) and (7) into eq. (4). After some transformation we obtain:
 
d=√[(b2-b1)2/(m2+1)2+m2(b2-b1)2/(m2+1)2]=[|b2-b1|/(m2+1)]√(m2+1)
 
Final answer is as follows:
 

d=|b2-b1|/√(m2+1)   (8)

Comments

Hi Kirill,
You can also get this formula without using coordinates, by relating the perpendicular distance d between the two lines to their vertical distance Δb=|b2-b1| in a right triangle whose hypotenuse is Δb. The slope of either line can be written as m=tanθ, where θ is the slope angle and, by similarity, also the angle between d and Δb, so that
m = tanθ = √(Δb2-d2) /d ⇒ m2 = (Δb2-d2) /d2 = Δb2/d2 -1 ⇒ Δb2/d2 = m2+1 ⇒ d = Δb/√(m2+1).
Hi, Andre:
 
I realize that. However, I met a few students, who need to operate with slopes and need to know that slopes of a line and a perpendicular to it are inverse reciprocal to each other, but those students have no idea about trigonometry. I will make a second post citing your derivation, for more advanced students.
Thanks for citing me in your second post. Actually, the students do not need to know trigonometry for this, only the Pythagorean theorem and the similarity theorem AAA.
You can nicely demonstrate the formula by shining two flashlights (better: laser pointers) parallel to each other at an angle at a surface. You can even measure the distance d between the flashlights and Δb between the light spots on the surface as a function of the angle of incidence. When they later learn about refraction/interference in a thin film this will be very useful!