Because a parallel line is a line that has an equal distance with the opposite line, there is a unique distance between the two parallel lines. Given the equations of two non-vertical parallel lines
y
=
m
x
+
b
1
{\displaystyle y=mx+b_{1}\,}
y
=
m
x
+
b
2
,
{\displaystyle y=mx+b_{2}\,,}
the distance between the two lines can be found by solving the linear systems
{
y
=
m
x
+
b
1
y
=
−
x
/
m
{\displaystyle {\begin{cases}y=mx+b_{1}\\y=-x/m\end{cases}}}
and
{
y
=
m
x
+
b
2
y
=
−
x
/
m
{\displaystyle {\begin{cases}y=mx+b_{2}\\y=-x/m\end{cases}}}
to get the coordinates of the points. The solutions to the linear systems are the points
(
x
1
,
y
1
)
=
(
−
b
1
m
m
2
+
1
,
b
1
m
2
+
1
)
{\displaystyle \left(x_{1},y_{1}\right)\ =\left({\frac {-b_{1}m}{m^{2}+1}},{\frac {b_{1}}{m^{2}+1}}\right)\,}
and
(
x
2
,
y
2
)
=
(
−
b
2
m
m
2
+
1
,
b
2
m
2
+
1
)
.
{\displaystyle \left(x_{2},y_{2}\right)\ =\left({\frac {-b_{2}m}{m^{2}+1}},{\frac {b_{2}}{m^{2}+1}}\right).\,}
The distance between the points is
d
=
(
b
1
m
−
b
2
m
m
2
+
1
)
2
+
(
b
2
−
b
1
m
2
+
1
)
2
,
{\displaystyle d={\sqrt {\left({\frac {b_{1}m-b_{2}m}{m^{2}+1}}\right)^{2}+\left({\frac {b_{2}-b_{1}}{m^{2}+1}}\right)^{2}}}\,,}
which reduces to
d
=
|
b
2
−
b
1
|
m
2
+
1
.
{\displaystyle d={\frac {|b_{2}-b_{1}|}{\sqrt {m^{2}+1}}}\,.}
When the lines are given by
a
x
+
b
y
+
c
1
=
0
{\displaystyle ax+by+c_{1}=0\,}
a
x
+
b
y
+
c
2
=
0
,
{\displaystyle ax+by+c_{2}=0,\,}
their distance can be expressed as
d
=
|
c
2
−
c
1
|
a
2
+
b
2
.
{\displaystyle d={\frac {|c_{2}-c_{1}|}{\sqrt {a^{2}+b^{2}}}}.}