Math calculator

Intersection of Two Lines Calculator

One point, none, or infinitely many.

Where two lines meet

Both written as ax + by = c.

First line: a₁x + b₁y = c₁

Second line: a₂x + b₂y = c₂

determinant −2

(3, 2)

A single crossing point, at a right angle.

x

3

exact

y

2

exact

Determinant

−2

zero means the slopes match

Relationship

point

one solution

Angle between

90°

a right angle

  • Solved by Cramer’s rule on exact fractions, so an intersection at a third or a seventh comes back as that fraction rather than as a decimal that has already lost information.
  • The normal vectors have a dot product of exactly zero, so the lines meet at a right angle — tested that way rather than through a product of slopes, which fails when one line is vertical.

The determinant is computed on exact fractions, so a parallel pair is recognised as parallel rather than as crossing somewhere very far away.

What this tool shows

Two lines have exactly three possibilities, and the determinant decides between them. Zero means the slopes match — and then a second test splits parallel (no solution) from the same line (infinitely many).

  • The crossing point of two lines
  • Parallel lines, and why there is no solution
  • Identical lines, and why there are infinitely many
  • The angle at which they meet
  • Vertical lines, which need no special case here
  • What the determinant is actually testing
Exact fractions All three outcomes Parallel vs identical Angle between

Standard form, so a vertical line is no special case.

Updated 7 September 2026 · Works in any browser, no installation

The determinant decides which of three answers you get. For x + y = 5 and x − y = 1 it is −2, so the lines cross exactly once, at (3, 2). A determinant of zero means the slopes match, and then the constants decide whether the lines are parallel or the same line written twice.

At a glance

Formula shown
With a₁x + b₁y = c₁ and a₂x + b₂y = c₂, the determinant is a₁b₂ − a₂b₁. When it is non-zero, x = (c₁b₂ − c₂b₁)/det and y = (a₁c₂ − a₂c₁)/det. When it is zero the lines are parallel, and identical if the constants scale to match.
Scenario support
Solving a pair of simultaneous equations geometrically; finding where two paths cross; checking whether two constraints are compatible.
Educational estimate
Planning support from the values you enter — not professional advice.

Three outcomes

Two straight lines in a plane can do exactly three things, and a page that reports only the first is answering the easy third of the question.

Cross once. Different slopes. One solution, and it is the common case.

Parallel and distinct. Same slope, different intercepts. They never meet, and the system has no solution.

The same line. Same slope, same intercept, written two different ways. Every point on it is a solution, so there are infinitely many.

In simultaneous-equation language those are the unique, inconsistent and dependent cases. The geometry and the algebra are describing the same three situations, which is worth noticing because the algebra makes it look like arithmetic and the geometry makes it obvious.

What the determinant tests

a₁b₂ − a₂b₁ is the cross product of the two coefficient pairs, and it is zero exactly when those pairs are proportional.

Proportional coefficients mean the same slope, because the slope of ax + by = c is −a/b and scaling both leaves that unchanged.

So the determinant is a parallelism test, dressed as arithmetic. When it is non-zero, Cramer’s rule divides by it — and the closer to zero it is, the larger the coordinates, which is exactly what nearly-parallel lines look like.

Computing it exactly matters more than it might seem. In floating point a determinant that ought to be zero often arrives as a tiny non-zero number, and dividing by that gives an intersection hundreds of billions of units away, reported with complete confidence. On this page the coefficients are kept as fractions and the test is exact.

Why standard form

Both lines are entered as ax + by = c rather than y = mx + c, and that is deliberate.

Slope-intercept form cannot write a vertical line. There is no m for x = 3. Any page built on y = mx + c has to special-case it, and special cases are where the bugs live.

Standard form has no such gap: x = 3 is 1x + 0y = 3, an ordinary set of coefficients requiring no separate branch.

It also makes the determinant natural, since the coefficients are already laid out as a matrix. And the pair (a, b) is the normal vector to the line, which is why perpendicularity can be tested as a₁a₂ + b₁b₂ = 0 — a dot product of zero — and why that test keeps working when one line is vertical.

The angle between them

When the lines cross, they do so at some angle, and there are two of them — supplementary, adding to 180°. The acute one is what gets quoted.

It comes from the difference of the slopes: tanθ = |(m₂ − m₁)/(1 + m₁m₂)|.

The denominator is the interesting part. When it is zero, the tangent is undefined and the angle is 90° — which is the m₁m₂ = −1 perpendicularity condition arriving from a different direction.

This page does not use that formula for the perpendicular test, because it needs both slopes to exist. The dot product of the normals is zero in exactly the same cases and keeps working when one line is vertical.

Where it gets used

Simultaneous equations. Every two-variable system is this problem. The three outcomes are the three things a system can do.

Linear programming. The corners of a feasible region are intersections of constraint lines, and the optimum sits at one of them.

Computer graphics and games. Ray casting, collision detection and clipping are all line intersections, run millions of times a second — which is why the degenerate cases have to be handled rather than hoped past.

Surveying and navigation. Fixing a position from two bearings is finding where two lines cross.

Sources and methodology

Cramer’s rule and the degenerate cases are standard; these are the references.

Method. The determinant is computed on exact rationals, which is not a precision nicety: its being zero is the whole classification, and a value that should be exactly zero arriving as 1e−17 would send the page down the crossing branch and produce coordinates the size of a galaxy. Perpendicularity is tested as a₁a₂ + b₁b₂ = 0 — the dot product of the two normals — rather than through a product of slopes, because that product does not exist when a line is vertical. The suite substitutes every returned intersection back into both original equations. That engine is verified on every change against 119 hand-written assertions, including that every reported intersection satisfies both original equations by substitution across every non-degenerate integer coefficient pair in a seven-by-seven grid. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

System of EquationsSolve linear systems in up to six unknowns with exact fractions — row operations, the matrix form, Cramer’s rule, and the parametric family when there is no single answer.
Line EquationThe equation of a line in all three standard forms from two points or from a point and a slope, with the intercepts and the vertical case that has no y = mx + c form at all.
Parallel and Perpendicular LinesBoth lines through your point at once — and the two cases where the slopes-multiply-to-−1 rule does not apply, because 0 × undefined is not −1.
SlopeSlope as an exact fraction, with the vertical case reported as undefined rather than as a division by zero — and the angle, gradient percentage and both related slopes alongside it.
DistanceThe distance between two points in the plane or in space, kept exact as a surd wherever the square root does not come out — √50 stays √50, and is also shown as 5√2.
Plane EquationThe equation of a plane through three points, with its normal vector and the signed distance from a fourth — so you get which side, not only how far.

More in Math, or browse all calculators.

Read the guide

With three or more unknowns the same determinant idea generalises — the System of Equations Calculator handles the larger cases.

Educational use disclaimer

This is an educational tool. Both lines are entered in the form ax + by = c, which can describe any line including a vertical one.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 7 September 2026

  1. Published the line intersection page computing the determinant on exact fractions, since 'is it zero' is the whole classification — in floating point a determinant that should be zero arrives as 1e−17 and the page would report an intersection at coordinates the size of a galaxy.
  2. Separates parallel from identical rather than collapsing both into 'no single point', because one means no solution and the other means infinitely many.
  3. Takes both lines in standard form, so a vertical line needs no special case — and tests perpendicularity on the dot product of the normals, which keeps working when one line has no slope.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.