Academy
Formulas/maths/Pair Of Straight Lines/Distance Between Parallel Lines

Distance Between Parallel Lines

Distance between the two parallel lines represented by ax² + 2hxy + by² + 2gx + 2fy + c = 0, when h² = ab. Equivalently written as 2√((f²−bc)/(b(a+b))) using the y-coefficient form.
Derivation

When ax2+2hxy+by2+2gx+2fy+c=0ax^2+2hxy+by^2+2gx+2fy+c=0 represents two parallel lines (h2=abh^2=ab, af2=bg2af^2=bg^2), they have the form:

(ax+by+p)(ax+by+q)=0(\sqrt{a}x+\sqrt{b}y+p)(\sqrt{a}x+\sqrt{b}y+q) = 0

where p+q=2g/a=2f/bp+q = 2g/\sqrt{a} = 2f/\sqrt{b} and pq=cpq = c.

The two lines are ax+by+p=0\sqrt{a}x+\sqrt{b}y+p = 0 and ax+by+q=0\sqrt{a}x+\sqrt{b}y+q = 0.

Distance between two parallel lines lx+my+p=0lx+my+p=0 and lx+my+q=0lx+my+q=0:

d=pql2+m2=pqa+bd = \frac{|p-q|}{\sqrt{l^2+m^2}} = \frac{|p-q|}{\sqrt{a+b}}

Now:

(pq)2=(p+q)24pq=4g2a4c=4(g2ac)a(p-q)^2 = (p+q)^2-4pq = \frac{4g^2}{a} - 4c = \frac{4(g^2-ac)}{a} pq=2g2aca|p-q| = \frac{2\sqrt{g^2-ac}}{\sqrt{a}}

Therefore:

d=2g2ac/aa+b=2g2aca(a+b)d = \frac{2\sqrt{g^2-ac}/\sqrt{a}}{\sqrt{a+b}} = 2\sqrt{\frac{g^2-ac}{a(a+b)}}

Alternative form using ff: Since af2=bg2af^2=bg^2, an equivalent expression is 2(f2bc)/(b(a+b))2\sqrt{(f^2-bc)/(b(a+b))}.

Check: For d>0d > 0, we need g2>acg^2 > ac (for distinct parallel lines; g2=acg^2 = ac gives coincident lines).