Skip to content

Mathematics · Ch 17 — Pair of Straight Lines

Distance Between Parallel Lines and Point of Intersection

17.7

Distance Between Parallel Lines and Point of Intersection

Once we know that ax2+2hxy+by2+2gx+2fy+c=0ax^2+2hxy+by^2+2gx+2fy+c=0 represents a genuine pair of straight lines (via the condition of the previous section), two further practical questions arise: if the two lines are parallel, how far apart are they; and if they intersect, where exactly do they meet?

Distance between parallel lines. Two lines are parallel exactly when they share the same homogeneous (degree-2) part, i.e. when h2=abh^2=ab, so we may write them as lx+my+c1=0lx+my+c_1=0 and lx+my+c2=0lx+my+c_2=0 for the same l,ml,m but different constants c1,c2c_1,c_2. Their product is

(lx+my+c1)(lx+my+c2)=l2x2+2lm xy+m2y2+l(c1+c2)x+m(c1+c2)y+c1c2,(lx+my+c_1)(lx+my+c_2) = l^2x^2 + 2lm\,xy + m^2y^2 + l(c_1+c_2)x + m(c_1+c_2)y + c_1c_2,

so matching coefficients, a=l2a=l^2, b=m2b=m^2, 2g=l(c1+c2)2g=l(c_1+c_2), c=c1c2c=c_1c_2. The distance between the two parallel lines is the standard formula ∣c1−c2∣l2+m2\dfrac{|c_1-c_2|}{\sqrt{l^2+m^2}}. To express ∣c1−c2∣|c_1-c_2| via a,g,ca,g,c, use (c1−c2)2=(c1+c2)2−4c1c2=4g2l2−4c=4(g2−ac)a(c_1-c_2)^2=(c_1+c_2)^2-4c_1c_2 = \dfrac{4g^2}{l^2} - 4c = \dfrac{4(g^2-ac)}{a} (since l2=al^2=a), so ∣c1−c2∣=2g2−aca|c_1-c_2| = 2\sqrt{\dfrac{g^2-ac}{a}}. Since l2+m2=a+bl^2+m^2=a+b, the distance becomes

d=2(g2−ac)/aa+b=2g2−aca(a+b).d = \frac{2\sqrt{(g^2-ac)/a}}{\sqrt{a+b}} = 2\sqrt{\frac{g^2-ac}{a(a+b)}}.

As a worked check, 4x2+12xy+9y2−10x−15y+4=04x^2+12xy+9y^2-10x-15y+4=0 has a=4,h=6,b=9a=4,h=6,b=9 (indeed h2=36=abh^2=36=ab, confirming parallel lines), g=−5,c=4g=-5,c=4, giving d=225−164×13=2952=31313d=2\sqrt{\dfrac{25-16}{4\times13}}=2\sqrt{\dfrac{9}{52}}=\dfrac{3\sqrt{13}}{13} — matching the direct computation from the factored lines 2x+3y−1=02x+3y-1=0 and 2x+3y−4=02x+3y-4=0.

Point of intersection. When the lines are not parallel (h2≠abh^2\neq ab), their point of intersection is found using elementary calculus: the point where two linear factors meet is where both partial derivatives of the quadratic expression vanish simultaneously. Differentiating ax2+2hxy+by2+2gx+2fy+cax^2+2hxy+by^2+2gx+2fy+c with respect to xx and to yy and setting each to zero gives

ax+hy+g=0,hx+by+f=0,ax+hy+g=0, \qquad hx+by+f=0,

a pair of simultaneous linear equations solved by Cramer's rule:

x=hf−bgab−h2,y=gh−afab−h2.x = \frac{hf-bg}{ab-h^2}, \qquad y = \frac{gh-af}{ab-h^2}.

For example, x2−y2−x+5y−6=0x^2-y^2-x+5y-6=0 has a=1,h=0,b=−1,g=−12,f=52a=1,h=0,b=-1,g=-\tfrac12,f=\tfrac52; solving x−12=0x-\tfrac12=0 and −y+52=0-y+\tfrac52=0 gives the intersection point (12,52)\left(\tfrac12,\tfrac52\right), which indeed satisfies both factored lines x−y+2=0x-y+2=0 and x+y−3=0x+y-3=0. …