StatGardenREF. DESK
Calculators/Maths/Intersection of a circle and a line
Maths

Intersection of a circle and a line calculator

Where a line y = mx + c crosses a circle centred at (h, k).

Published 6 August 2026 · Updated 23 September 2026

What this calculator does

Substituting a line into a circle equation produces a quadratic, and the discriminant of that quadratic answers the geometric question directly. Positive means two crossings, zero means the line is tangent, negative means it misses entirely.

The chord length falls out of the same working. A line through the centre of a radius 5 circle gives a chord of 10.000, which is the diameter, and moving the line outward shortens the chord until it vanishes at tangency.

The formula

FormulaSubstitute the line into (x−h)²+(y−k)²=r² to get a quadratic Ax²+Bx+C=0 with A=1+m², B=2(m(c−k)−h), C=h²+(c−k)²−r²

The line equation is substituted into the circle equation, producing a quadratic in x. Its discriminant determines how many intersections exist, and solving it gives their coordinates.

TermMeaning
DiscriminantB² − 4AC of the resulting quadratic, which counts the intersections.
TangentA line touching at exactly one point, where the discriminant is zero.
ChordThe segment between the two intersection points.

The inputs explained

FieldWhat to enter
Circle centre hx coordinate of the circle centre.
Circle centre ky coordinate of the circle centre.
Radius rRadius of the circle.
Line slope mSlope of the line.
Line y-intercept cy-intercept of the line.

When to use it

Finding where a path crosses a boundary

A straight path meeting a circular region gives exactly this problem.

Testing for tangency

A discriminant of zero confirms the line just touches.

Measuring a chord

The distance between intersections is the chord length.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does the intercept shorten the chord?

The same line slid outward by raising its intercept.

Circle centred at the origin, radius 5, slope 1
Line y-interceptDiscriminantChord length
c = 0200.00010.000
c = 5100.0007.071
c = 7.070.06040.1738
Through the centre the chord is 10.000, the full diameter, with a discriminant of 200.000. Raising the intercept to 7.07 leaves a discriminant of just 0.0604 and a chord of 0.1738, almost exactly tangent.

Questions

What does a negative discriminant mean?

That the quadratic has no real solutions, so the line never meets the circle. Geometrically the line passes outside it, and the calculator reports no intersection rather than producing complex coordinates.

Why does substituting produce a quadratic?

Because the circle equation is second degree in both variables. Replacing y with a linear expression in x leaves x appearing squared, which is a quadratic by definition.

What about a vertical line?

It cannot be written as y = mx + c, so this form does not handle it. A vertical line x = a is substituted directly into the circle equation, which gives a quadratic in y instead.

How is tangency detected reliably?

By the discriminant being zero, though floating point arithmetic rarely produces exactly zero. The calculator treats values very close to zero as tangent, which is why a near-miss can show an extremely short chord instead.

For converting a circle equation to centre-radius form, see the circle general to standard form calculator. For the line itself, see the line equation calculator.