Acute angle θ between two lines with slopes m₁ and m₂. The obtuse angle is π − θ.
Derivation
Let the two lines have inclinations θ1 and θ2, so m1=tanθ1 and m2=tanθ2. The angle from line 1 to line 2 is ϕ=θ2−θ1. By the tangent subtraction identity:
Two intersecting lines form two pairs of supplementary angles. Taking the acute angle θ:
tanθ=1+m1m2m1−m2
Special cases
Parallel:tanθ=0⇒m1=m2.
Perpendicular:tanθ→∞⇒1+m1m2=0⇒m1m2=−1.
General form version
For a1x+b1y+c1=0 and a2x+b2y+c2=0, substitute mi=−ai/bi:
tanθ=a1a2+b1b2a1b2−a2b1
Key Idea
Vector form. Let $\vec{d_1}$ and $\vec{d_2}$ be direction vectors of the two lines. The angle $\theta$ between them satisfies:
>
> $$
> \cos\theta = \frac{|\vec{d_1} \cdot \vec{d_2}|}{|\vec{d_1}||\vec{d_2}|}
> $$
>
> The absolute value gives the acute angle. With $\vec{d_1} = (1, m_1)$ and $\vec{d_2} = (1, m_2)$:
>
> $$
> \cos\theta = \frac{|1 + m_1 m_2|}{\sqrt{1+m_1^2}\sqrt{1+m_2^2}}
> $$
>
> The $\tan\theta$ formula and this $\cos\theta$ formula are equivalent — related by the identity $\tan\theta = \sin\theta/\cos\theta$ with $\sin\theta = |\vec{d_1} \times \vec{d_2}|/(|\vec{d_1}||\vec{d_2}|)$. In 3D, the dot product form generalises directly; the $\tan\theta$ slope form does not.