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
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.
| Term | Meaning |
|---|---|
| Discriminant | B² − 4AC of the resulting quadratic, which counts the intersections. |
| Tangent | A line touching at exactly one point, where the discriminant is zero. |
| Chord | The segment between the two intersection points. |
The inputs explained
| Field | What to enter |
|---|---|
| Circle centre h | x coordinate of the circle centre. |
| Circle centre k | y coordinate of the circle centre. |
| Radius r | Radius of the circle. |
| Line slope m | Slope of the line. |
| Line y-intercept c | y-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.
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.