Angle Between Two Lines

When two straight lines intersect in the coordinate plane, they form two pairs of vertical angles. Knowing the slopes of the lines lets us compute exactly how large those angles are — without ever drawing a picture. This is one of the elegant payoffs of analytic geometry: geometric relationships become algebraic calculations. The key insight is that the slope of a line equals the tangent of the angle that line makes with the positive x-axis. If two lines have slopes m₁ and m₂, the angle between them can be found by applying the tangent subtraction formula from trigonometry. The result is a compact formula involving only m₁ and m₂. This concept has practical importance in physics (angle of incidence in optics), engineering (road gradient intersections), and computer graphics (rotation transformations). Mastering it deepens your understanding of both coordinate geometry and trigonometry simultaneously.

Key takeaways
  • Slope as a Tangent
  • The Angle Between the Lines
  • Taking the Absolute Value
  • Special Cases
  • When One Line is Vertical

Slope as a Tangent

Let line L₁ make angle α with the positive x-axis, and line L₂ make angle β with the positive x-axis. By definition of slope, m₁ = tan α and m₂ = tan β. Both α and β lie in the interval [0°, 180°) because a line's inclination is measured from 0° to just under 180°.

The Angle Between the Lines

The acute (or right) angle θ between the two lines satisfies θ = α − β (or β − α), whichever is positive and at most 90°. Using the tangent subtraction identity, tan(α − β) = (tan α − tan β) / (1 + tan α · tan β), we substitute m₁ = tan α and m₂ = tan β to get tan θ = (m₁ − m₂) / (1 + m₁m₂).

Taking the Absolute Value

Because we always want the acute angle (θ between 0° and 90°), we take the absolute value: tan θ = |(m₁ − m₂) / (1 + m₁m₂)|. Applying arctan to both sides gives θ = arctan(|(m₁ − m₂) / (1 + m₁m₂)|). The obtuse angle at the same intersection is simply 180° − θ.

Special Cases

Parallel lines: if m₁ = m₂, the numerator is 0, so tan θ = 0 and θ = 0° — the lines do not intersect (or coincide). Perpendicular lines: if m₁m₂ = −1, the denominator is 0, meaning tan θ → ∞, so θ = 90°. These two special cases match the conditions for parallelism and perpendicularity you already know from coordinate geometry.

When One Line is Vertical

If one line is vertical (undefined slope), the formula cannot be used directly. Instead, find the inclination angle of the other line using α = arctan(m), then compute the angle between that line and the vertical line (which has inclination 90°) as |90° − α|.

The Key Equation

tan⁡θ=∣m1−m21+m1m2∣\tan\theta = \left|\frac{m_1 - m_2}{1 + m_1 m_2}\right|
  • \theta — Acute angle between lines (degrees or radians): The smaller of the two angles formed where the lines intersect; always between 0° and 90°.
  • m_1 — Slope of line 1 (dimensionless): The gradient of the first line, equal to rise over run or tan(α) where α is its inclination angle.
  • m_2 — Slope of line 2 (dimensionless): The gradient of the second line, equal to rise over run or tan(β) where β is its inclination angle.
  • 1 + m_1 m_2 — Denominator term (dimensionless): When this equals zero, the lines are perpendicular (θ = 90°). Comes from the cosine part of the tangent subtraction formula.

Worked Example

Problem. Find the acute angle between the lines y = 2x + 3 and y = (1/3)x − 1.

θ=arctan⁡(1)=45∘\theta = \arctan(1) = 45^\circ

Answer. The acute angle between the two lines is 45°.

Figure
Diagram
xyL₁ (m₁=2)L₂ (m₂=⅓)θ=45°α₁ = inclination of L₁α₂ = inclination of L₂, θ = α₁ − α₂
Origins · 1 minRené Descartes and how this was discovered
RD
René Descartes
1596–1650 · French

Descartes invented the Cartesian coordinate system in his 1637 work La Géométrie, an appendix to his Discours de la Méthode. By assigning numerical coordinates to points, he united algebra and geometry, making it possible to express geometric relationships — like the angle between two lines — as algebraic formulas involving slopes. Descartes reportedly developed his coordinate system while lying in bed watching a fly crawl on the ceiling, wondering how to describe the fly's position mathematically.

  • Slope of a Line — The angle formula is built entirely from slopes m₁ and m₂, so a solid understanding of slope as rise/run and as tan(inclination) is essential.
  • Tangent Addition and Subtraction Formulas — The derivation of the angle-between-lines formula uses tan(α − β) = (tan α − tan β)/(1 + tan α tan β) directly.
  • Parallel and Perpendicular Lines — Parallel (m₁ = m₂, θ = 0°) and perpendicular (m₁m₂ = −1, θ = 90°) are the two extreme special cases of the angle formula.
  • Inverse Trigonometric Functions — After computing tan θ with the formula, you apply arctan to find the actual angle in degrees or radians.