2

I wonder where does this formula is coming from? It is for finding the distance between two parallel lines when we have their linear equation: First line is:$ax+by+c=0$ Second line is:$ax+by+c_1=0$ Their distance :$$\frac{|c-c_1|}{\sqrt{a^2+b^2}}$$

Abbas
  • 323

4 Answers4

2

HINT

Calculate the distance of each line from the origin that is

$$d=\frac{|a\cdot0+b\cdot0+c|}{\sqrt{a^2+b^2}}=\frac{|c|}{\sqrt{a^2+b^2}}$$

than take

  • $|d_1-d_2|$ for the line on the same side ($c$ and $c_1$ have same sign)
  • $|d_1+d_2|$ for the line on diffent sides ($c$ and $c_1$ have different sign)

from which the given formula is obtained.

user
  • 154,566
  • Actually I wanted to ask about for the formula you have just used for calculating distance of a point (origin in your case)from a line. Where does it come from? – Abbas Feb 28 '18 at 16:06
  • Ah ok, for that I've just given the link here https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line (click on "distance") whwre you can find the proof for the standard formula. Please don't hesiste to ask for any other clarification! – user Feb 28 '18 at 16:10
  • Anyway if your aim is that you should re-formulate the OP as "Distance between a point and a line" and not "Distance between two parallel lines by having linear equations". It should be more clear to understand what you are asking for. – user Feb 28 '18 at 16:13
  • Take also a look here for related topic with proof https://math.stackexchange.com/questions/85761/distance-between-a-point-and-a-line – user Feb 28 '18 at 16:23
  • Shouldn't this$|d_1-d_2|$ be $|d_1+d_2|$because once we have calculated distance from origin we would add them to have total distance from each other – Abbas Feb 28 '18 at 16:55
  • @Abbas Think to the case with $c=c_1$ in this case the distance is equal to 0 then we need to take $|c-c_1|$. Of course the $|d_1-d_2|$ must be interpreted according to the sign of $c$ and $c_1$ but the final formula is correct. – user Feb 28 '18 at 16:59
  • @Abbas I've added a more correct and detailed explanation on this point. – user Feb 28 '18 at 17:04
  • Then it should be $||c|-|c_1||$in numerator. Shouldn't be equal to $|c-c_1|$ – Abbas Feb 28 '18 at 17:16
  • If line are on the same side $||c|-|c_1||=|c-c_1|$ if are on different sides $||c|+|c_1||=|c-c_1|$. – user Feb 28 '18 at 17:21
  • But isn't the formula skiping this fact? – Abbas Feb 28 '18 at 17:22
  • @Abbas as you can see, in any case at the numerator we have $|c-c_1|=|c_1-c|$ thus the formula always works! – user Feb 28 '18 at 17:25
  • @Abbas What is the extra information? Try with some simple example to see how it works for example y+x=1 and y+x=3 or y+x=-2. – user Feb 28 '18 at 17:33
  • You are right. I tried and convinced myself(there was sth that I couldn't understand now I do.)thank you. – Abbas Feb 28 '18 at 17:38
  • Well done, You are welcome! Bye – user Feb 28 '18 at 17:43
  • 1
    gimusi.As usual I refer to your answer.:))) – Peter Szilas Mar 01 '18 at 09:03
2

Alternatively: the perpendicular line that passes through origin is: $bx-ay=0$. It crosses the two parallel lines at: $$\left(-\frac{ac}{a^2+b^2},-\frac{bc}{a^2+b^2}\right) \ \ \text{and} \ \ \left(-\frac{ac_1}{a^2+b^2},-\frac{bc_1}{a^2+b^2}\right).$$ The distance between these points is: $$d=\sqrt{\left(\frac{a(c-c_1)}{a^2+b^2}\right)^2+\left(\frac{b(c-c_1)}{a^2+b^2}\right)^2}=\frac{|c-c_1|}{\sqrt{a^2+b^2}}.$$

farruhota
  • 31,482
1

Consider $ax+by+c=0$, assume $a,b,c \not =0.$

$y=0$: $X-$intercept: $x=-c/a;$

$x=0:$ $Y-$intercept: $y =-c/b.$

$A(-c/a,0); B(0,-c/b);$ $O(0,0);$

form a right $\triangle ABO$ with

lengths of legs $|c/a|$ and $|c/b|.$

Lenght of hypotenuse : $\sqrt{(c/a)^2+(c/b)^2}.$

Height, $h$, on $AB$ is the desired distance to the origin:

Area of $\triangle ABO$ :

Area $= (1/2)|c/a||c/b| = (1/2)h\sqrt{(c/a)^2+(c/b)^2}.$

Solve for $h:$

$h= \dfrac{c^2}{|ab|}\dfrac {|ab|}{|c|\sqrt{(a^2+b^2)}}$.

$h =\dfrac{|c|}{a^2+b^2}$.

Left to do :

The above gives you the distance of one line from the origin, regardless of the sign of $c.$

Now you have 2 lines , with $c,c _1.$

Find the distance between them.

(Does gimusi's answer help?)

Peter Szilas
  • 20,344
  • 2
  • 17
  • 28
1

As an alternative suppose wlog that $b\neq 0$ then translate vertically with $by\to by-c_1$ and obtain

  • $ax+by+c=0\to ax+by+c-c_1=0$
  • $ax+by+c_1\to ax+by=0$

then the distance between the two lines is equal to the distance of the translated line $ax+by+c-c_1=0$ from the origin that is indeed the given expression.

user
  • 154,566