Skip to content

Mathematics · Ch 17 — Pair of Straight Lines

Angle Between a Pair of Lines

17.3

Angle Between a Pair of Lines

Suppose ax2+2hxy+by2=0ax^2+2hxy+by^2=0 represents two real lines through the origin (so h2>abh^2>ab, as in the previous section), with slopes m1m_1 and m2m_2. We can find m1+m2m_1+m_2 and m1m2m_1m_2 directly from the coefficients, without first solving for the individual lines. Writing the equation as a quadratic in y/xy/x (dividing by x2x^2, assuming b≠0b\neq0):

b(yx)2+2h(yx)+a=0,b\left(\frac{y}{x}\right)^2 + 2h\left(\frac{y}{x}\right) + a = 0,

whose roots are precisely m1=y1/x1m_1=y_1/x_1 and m2=y2/x2m_2=y_2/x_2, the two slopes. By the sum and product of roots of a quadratic,

m1+m2=−2hb,m1m2=ab.m_1 + m_2 = -\frac{2h}{b}, \qquad m_1 m_2 = \frac{a}{b}.

The angle θ\theta between two lines of slopes m1,m2m_1,m_2 satisfies the standard formula tan⁡θ=∣m1−m21+m1m2∣\tan\theta = \left|\dfrac{m_1-m_2}{1+m_1m_2}\right|. To express this in terms of a,h,ba,h,b alone, first compute (m1−m2)2(m_1-m_2)^2 using the identity (m1−m2)2=(m1+m2)2−4m1m2(m_1-m_2)^2=(m_1+m_2)^2-4m_1m_2:

(m1−m2)2=4h2b2−4ab=4(h2−ab)b2⟹m1−m2=±2h2−abb.(m_1-m_2)^2 = \frac{4h^2}{b^2} - \frac{4a}{b} = \frac{4(h^2-ab)}{b^2} \quad\Longrightarrow\quad m_1-m_2 = \pm\frac{2\sqrt{h^2-ab}}{b}.

Also, 1+m1m2=1+ab=a+bb1+m_1m_2 = 1+\dfrac{a}{b} = \dfrac{a+b}{b}. Substituting both into the slope-angle formula, the factor of bb cancels between numerator and denominator:

tan⁡θ=∣  2h2−abb  a+bb∣=∣2h2−aba+b∣.\tan\theta = \left|\frac{\;\dfrac{2\sqrt{h^2-ab}}{b}\;}{\dfrac{a+b}{b}}\right| = \left|\frac{2\sqrt{h^2-ab}}{a+b}\right|.

This is the angle-between-the-lines formula, valid whenever h2>abh^2>ab (so the square root is real) and a+b≠0a+b\neq0. When a+b=0a+b=0 the formula's denominator vanishes, meaning tan⁡θ→∞\tan\theta\to\infty, i.e. θ=90∘\theta=90^\circ — the two lines are perpendicular; this special case is examined fully in the next section.

As a worked example, take once more 2x2−3xy−2y2=02x^2-3xy-2y^2=0, whose lines are x−2y=0x-2y=0 (slope 12\tfrac12) and 2x+y=02x+y=0 (slope −2-2). Here a=2a=2, h=−32h=-\tfrac32, b=−2b=-2, so a+b=0a+b=0 and the formula predicts θ=90∘\theta=90^\circ. Checking directly: the product of the slopes is 12×(−2)=−1\tfrac12\times(-2)=-1, which is exactly the condition for two lines to be perpendicular — confirming the formula.

A second worked example shows the formula handling a genuinely acute, non-special angle. Take 2x2−7xy+3y2=02x^2-7xy+3y^2=0: here a=2a=2, h=−72h=-\tfrac72, b=3b=3, so h2−ab=494−6=254h^2-ab=\tfrac{49}{4}-6=\tfrac{25}{4} and a+b=5a+b=5. Then

tan⁡θ=∣225/45∣=∣2×525∣=1,θ=45∘.\tan\theta = \left|\frac{2\sqrt{25/4}}{5}\right| = \left|\frac{2\times\frac52}{5}\right| = 1, \qquad \theta = 45^\circ.

Factoring the equation directly gives (2x−y)(x−3y)=0(2x-y)(x-3y)=0 (slopes 22 and 13\tfrac13), and indeed tan⁡θ=∣2−131+2×13∣=∣5/35/3∣=1\tan\theta=\left|\dfrac{2-\frac13}{1+2\times\frac13}\right|=\left|\dfrac{5/3}{5/3}\right|=1, matching exactly. …