Intersection of Two Lines Calculator

Enter each line in general form a·x + b·y = c to find the point where the two lines cross, using Cramer's rule.

Quick Facts

General form
a·x + b·y = c
Both a line's slope-intercept and two-point forms convert into this format.
Cramer's rule
x = (c1b2-c2b1)/D, y = (a1c2-a2c1)/D
D = a1b2 - a2b1 is the determinant of the coefficient matrix.
Parallel test
D = 0
A zero determinant means the two lines have equal slope (parallel or identical).
Slope from general form
m = -a / b
Undefined (vertical line) when b = 0.

Your Results

Calculated
Intersection x
-
x = (c1b2 - c2b1) / D
Intersection y
-
y = (a1c2 - a2c1) / D
Slope of Line 1
-
m1 = -a1 / b1
Slope of Line 2
-
m2 = -a2 / b2

Ready

Enter both lines in a·x + b·y = c form, then press Calculate.

How to Find the Intersection of Two Lines

Two straight lines in a plane either cross at exactly one point, run parallel and never meet, or lie on top of each other and share every point. This calculator writes both lines in general form, a·x + b·y = c, and solves the resulting 2×2 system of linear equations with Cramer's rule to find the single (x, y) point that satisfies both equations at once — the coordinates where the two lines intersect.

Setting up the line equations

General form covers every straight line, including vertical ones that slope-intercept form cannot represent. If you have a line in slope-intercept form, y = mx + b, rearrange it to -mx + y = b, so a = -m, b = 1, and c is the y-intercept. If instead you know two points (x₁, y₁) and (x₂, y₂) on the line, use a = y₂ - y₁, b = x₁ - x₂, and c = a·x₁ + b·y₁ — this comes directly from the two-point form of a line and works even when the line is vertical (x₂ = x₁).

Solving with Cramer's rule

With line 1 as a₁x + b₁y = c₁ and line 2 as a₂x + b₂y = c₂, the system's determinant is D = a₁b₂ - a₂b₁. When D ≠ 0, the unique intersection point is x = (c₁b₂ - c₂b₁) / D and y = (a₁c₂ - a₂c₁) / D. A determinant of zero means the two lines have the same slope: if the equations are proportional (a₁/a₂ = b₁/b₂ = c₁/c₂) the lines are identical and intersect everywhere; otherwise they are parallel and never intersect.

Common mistakes

  • Mixing up a and b: in a·x + b·y = c, the coefficient a multiplies x and b multiplies y — swapping them silently rotates the line.
  • Forgetting the sign when converting from y = mx + b: the general-form coefficient of x is -m, not m; dropping the minus sign shifts the computed slope and intersection.
  • Assuming a solution always exists: if the determinant D is zero, there is no single intersection point (parallel lines) or infinitely many (identical lines) — check for that case before trusting a numeric answer.

Real-world applications

  • Break-even analysis finds where a cost line and a revenue line intersect to determine the break-even quantity.
  • Computer graphics and CAD software use line intersection to trim, clip, and join line segments and polygon edges.
  • Surveying and navigation locate a position by intersecting two bearing lines from known landmarks.
  • Physics problems use line intersection to find where two linear motion paths or graphs of two equations coincide.

Frequently Asked Questions

What is the formula for finding the intersection of two lines?
Write each line in general form a·x + b·y = c. If line 1 is a1x + b1y = c1 and line 2 is a2x + b2y = c2, compute the determinant D = a1b2 - a2b1. When D is not zero, the intersection is x = (c1b2 - c2b1) / D and y = (a1c2 - a2c1) / D, which is Cramer's rule applied to a 2×2 system.
What does it mean when two lines are parallel with no intersection?
Parallel lines have the same slope, which happens exactly when the determinant D = a1b2 - a2b1 equals 0. If D = 0 and the lines are not identical, the system has no solution, so the lines never cross.
How do I convert a slope-intercept equation to the general form used here?
Starting from y = mx + b, subtract mx from both sides to get -mx + y = b. That means a = -m, b = 1, and c = b (the y-intercept). A vertical line x = k becomes a = 1, b = 0, c = k, which slope-intercept form cannot represent.
Can two lines have infinitely many intersection points?
Yes. If both lines have the same equation up to a scalar multiple (D = 0 and the constant terms are also proportional), every point on one line lies on the other, so the two lines are identical and share infinitely many points.