🧮
🧮 Math & statistics

Intersection of Two Lines Calculator

Results update as you type.

Your numbers

Understanding the line intersection calculator — concept and principle

Two straight lines in a plane either cross at exactly one point, never meet (parallel) or lie on top of each other (identical). This calculator takes two lines written as a₁x + b₁y = c₁ and a₂x + b₂y = c₂, finds their intersection point and gives the angle between them. This is the same as solving a system of two linear equations, as in break-even or supply and demand problems.

Lines x − y = 1 and 2x + y = 8 crossing at (3, 2)The blue line x − y = 1 and the red line 2x + y = 8 cross at one point. Cramer’s rule uses D = 3: x = 9 ÷ 3 = 3 and y = 6 ÷ 3 = 2. The point (3, 2) satisfies both equations, and the lines meet at about 71.57°.Two roads meet at one spot01234502468(3, 2)x − y = 12x + y = 8D = 1·1 − (−1)·2= 3x = (1·1 − (−1)·8) ÷ 3= 9 ÷ 3 = 3y = (1·8 − 1·2) ÷ 3= 6 ÷ 3 = 2check: 3 − 2 = 1, 6 + 2 = 8angle ≈ 71.57°
The crossing point is the one (x, y) that satisfies both equations; D = 0 means parallel.

How it is calculated

The principle

Each equation describes all points that satisfy it, and the intersection is the one point that satisfies both. Cramer's rule solves the system by eliminating one variable: multiply the first equation by b₂ and the second by b₁, subtract, and y drops out, leaving D × x = c₁b₂ − b₁c₂. The determinant D measures how differently the two lines are oriented. When D = 0 the coefficients are proportional, the lines point in the same direction, and no unique solution exists.

For the angle, the vector (a, b) is perpendicular to its line, so the angle between the two normals equals an angle between the lines. The atan2 of the cross product over the dot product gives that angle robustly, from 0° to 180°.

Worked example

  1. Inputs: x − y = 1 and 2x + y = 8.
  2. D = 1 × 1 − (−1) × 2 = 3.
  3. x = (1 × 1 − (−1) × 8) ÷ 3 = 9 ÷ 3 = 3; y = (1 × 8 − 1 × 2) ÷ 3 = 6 ÷ 3 = 2. Intersection (3, 2).
  4. Angle: atan2(1 × 1 − 2 × (−1), 1 × 2 + (−1) × 1) = atan2(3, 1) ≈ 71.56505118°.

How to read the result

The intersection is the only pair (x, y) that makes both equations true, such as the price and quantity where supply equals demand. An angle of 90° means the lines are perpendicular. The output may exceed 90°; the acute angle between the lines is then 180° minus the shown value. A very small D compared with the coefficients means the lines are nearly parallel, so tiny changes in the inputs move the intersection a long way.

Common mistakes

Keep in mind: Results for nearly parallel lines are sensitive to rounding in the inputs. Measured data should be checked for this before the intersection is relied on.

Frequently asked questions

How can I tell whether parallel lines are identical?

When D = 0, check whether all three coefficients are proportional, a₁ : b₁ : c₁ = a₂ : b₂ : c₂. If so, the lines coincide.

How do I get the angle from slopes?

tan θ = |(m₂ − m₁) ÷ (1 + m₁m₂)|. For slopes 1 and −2, tan θ = 3, so θ ≈ 71.57°.

Can this be used for three equations?

Cramer's rule extends to 3 × 3 systems with three-variable determinants, but this calculator handles two lines in a plane.

Sources: G. Cramer, Introduction à l'analyse des lignes courbes algébriques (1750) · G. Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →