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.