Academy
Formulas/maths/Straight Lines/Angle Between Two Lines (General Form)

Angle Between Two Lines (General Form)

Acute angle between a₁x + b₁y + c₁ = 0 and a₂x + b₂y + c₂ = 0.
Derivation

For lines a1x+b1y+c1=0a_1x+b_1y+c_1=0 and a2x+b2y+c2=0a_2x+b_2y+c_2=0, the slopes are:

m1=a1b1,m2=a2b2m_1 = -\frac{a_1}{b_1}, \qquad m_2 = -\frac{a_2}{b_2}

Substituting into tanθ=m1m21+m1m2\tan\theta = \left|\dfrac{m_1-m_2}{1+m_1m_2}\right|:

m1m2=a1b1+a2b2=a2b1a1b2b1b2m_1 - m_2 = -\frac{a_1}{b_1} + \frac{a_2}{b_2} = \frac{a_2b_1 - a_1b_2}{b_1b_2} 1+m1m2=1+a1a2b1b2=b1b2+a1a2b1b21 + m_1m_2 = 1 + \frac{a_1a_2}{b_1b_2} = \frac{b_1b_2 + a_1a_2}{b_1b_2}

The b1b2b_1b_2 cancels:

tanθ=a1b2a2b1a1a2+b1b2\boxed{\tan\theta = \left|\frac{a_1b_2 - a_2b_1}{a_1a_2 + b_1b_2}\right|}

Parallel condition: a1b2=a2b1a_1b_2 = a_2b_1 (numerator vanishes).

Perpendicular condition: a1a2+b1b2=0a_1a_2 + b_1b_2 = 0 (denominator vanishes).

This form avoids computing slopes explicitly and is more convenient when lines are given in general form.