Suppose, one have two parallel lines given by the equations:

*y=mx+b*and

_{1}*y=mx+b*. Remember, if the lines are parallel, their slopes must be the same, so

_{2}*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 (x

_{1}, y_{1}), 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(x_{2},y_{2}).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,

y

_{1}=mx_{1}+b_{1 }(1)Same is true for B and the second line. So we can write:

y

_{2}=mx_{2}+b_{2 }(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=(y

_{2}-y_{1})/(x_{2}-x_{1}). In this case it is -1/m. So we obtain:(y

_{2}-y_{1})/(x_{2}-x_{1})=-1/m (3)The distance between two points, A and B, is given by:

d=√[(y

_{2}-y_{1})^{2}+(x_{2}-x_{1})^{2}] (4)From equations (1) and (2) we obtain:

(y2-y1)=m(x

_{2}-x_{1})+(b_{2}-b_{1}) (5)Plug in (y

_{2}-y_{1}) from eq. (5) into eq. (3) and solve for (x_{2}-x_{1}). We obtain upon solving:(x

_{2}-x_{1})=m(b_{2}-b_{1})/(m^{2}+1); (6)Substituting (6) into (3) immediately yields the following:

(y

_{2}-y_{1})=-(b_{2}-b_{1})/(m^{2}+1) (7)Now final step is to plug eq. (6) and (7) into eq. (4). After some transformation we obtain:

d=√[(b

_{2}-b_{1})^{2}/(m^{2}+1)^{2}+m^{2}(b_{2}-b_{1})^{2}/(m^{2}+1)^{2}]=[|b_{2}-b_{1}|/(m^{2}+1)]√(m^{2}+1)Final answer is as follows:

**d=|b**_{2}-b_{1}|/√(m^{2}+1) (8)

_{2}-b

_{1}|/√(m

^{2}+1) (8)

## Comments

perpendiculardistance d between the two lines to theirverticaldistance Δb=|b_{2}-b_{1}| 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^{2}-d^{2}) /d ⇒ m^{2}= (Δb^{2}-d^{2}) /d^{2}= Δb^{2}/d^{2}-1 ⇒ Δb^{2}/d^{2}= m^{2}+1 ⇒ d = Δb/√(m^{2}+1).