0

I am given the equation $|\frac{c_1-c_2}{\sqrt{a^2+b^2}}|$ to find the distance between 2 parallel lines, $ax+by+c_1=0$ and $ax+by+c_2=0$. I would like to know how this formula was derived. Normally, when finding the distance between 2 parallel lines, I would use Pythagoras' theorem, I have no idea how this equation was derived.

QuIcKmAtHs
  • 1,451

1 Answers1

1

A vector perpendicular to the lines is $(a,b)$, so the unit vector perpendicular to the lines is $\mathbf u = (a, b)/\sqrt{a^2 + b^2}$. Your two lines are given by $(x,y) \cdot \mathbf u = -c_i/\sqrt{a^2 + b^2}$ for $i = 1, 2$. In particular the multiple of the unit vector $\mathbf u$ which lies on the $i$-th line is $\mathbf p_i = -c_i/\sqrt{a^2 + b^2} \mathbf u$. What you want is the length of $\mathbf p_1 - \mathbf p_2$, which is given by your formula.

Exercise: find and prove a similar formula for the distance between parallel planes.

Addendum: given the discussion in the comments, you may be happier with a slightly different solution, also using the unit vector $\mathbf u$. Find one point $\mathbf q_i$ ($i = 1, 2$) on each line. For example, if $a \ne 0$, you can find the unique point with zero $y$ coordinate. The distance is $\left | (\mathbf q_1 - \mathbf q_2)\cdot \mathbf u \right |$. The case $a = 0$ has to be handled separately.

fred goodman
  • 4,253