Circle Intercept Calculator: Find Intersection Points
- First y-intercept
- Result
- Second x-intercept
- Result
- Second y-intercept
- Result
This calculator works out the intersection points where a straight line crosses a circle. You enter the circle’s center coordinates and radius, plus the line’s equation (in slope-intercept or standard form), and it returns the x and y coordinates of every point where the line meets the circle — typically two points, sometimes one (tangent), or none.
Formula
The calculator solves the system of two equations: the circle equation and the line equation. For a circle centered at (h, k) with radius r, and a line y = mx + b, the intersection points satisfy:
(x – h)² + (y – k)² = r²
Substitute y = mx + b into the circle equation, expand, and solve the resulting quadratic in x:
(1 + m²)x² + 2(m(b – k) – h)x + (h² + (b – k)² – r²) = 0
Using the quadratic formula, the two x-coordinates are:
x = [ -2(m(b – k) – h) ± sqrt(4(m(b – k) – h)² – 4(1 + m²)(h² + (b – k)² – r²)) ] / [2(1 + m²)]
Then y = mx + b gives the corresponding y-coordinates. Variables: h and k are the circle center coordinates (any real number), r is the radius (positive), m is the line slope (any real number), b is the y-intercept (any real number). The discriminant D = 4(m(b – k) – h)² – 4(1 + m²)(h² + (b – k)² – r²) decides the number of intersections: D > 0 gives two points, D = 0 gives one tangent point, D < 0 gives none.
Worked Example
Using the defaults: circle centered at (0, 0) with radius 5, and line y = x + 1.
Step 1: Substitute y = x + 1 into x² + y² = 25:
x² + (x + 1)² = 25
Step 2: Expand and simplify:
x² + x² + 2x + 1 = 25 → 2x² + 2x – 24 = 0 → x² + x – 12 = 0
Step 3: Solve the quadratic:
x = [-1 ± sqrt(1 + 48)] / 2 = [-1 ± 7] / 2 → x = 3 or x = -4
Step 4: Find y values:
For x = 3, y = 3 + 1 = 4. For x = -4, y = -4 + 1 = -3.
Result: The line intersects the circle at (3, 4) and (-4, -3). The calculator gives the same coordinates (rounded to 4 decimals).
When to Use a Circle Intercept Calculator
This calculation appears in many practical and academic contexts:
- Geometry homework or exam problems involving lines and circles
- Computer graphics: ray-circle intersection for rendering or collision detection
- Physics: finding where a straight trajectory crosses a circular boundary
- Engineering: locating points on a circular flange or gear where a straight edge meets
- Robotics: determining if a sensor beam hits a circular obstacle
The calculator saves time when you have many lines to test against one circle, or when the numbers are messy. It also helps verify hand calculations.
How to Read the Results
The output shows two points (x1, y1) and (x2, y2). If the line is tangent to the circle, both points will be nearly identical (or exactly identical with rounding). If the line misses the circle entirely, the square root becomes negative, and the calculator returns “NaN” (not a number) — that means no real intersection exists. Always check the discriminant manually if you get NaN: a negative discriminant confirms no intersection.
When the line is vertical (x = constant), the slope m is undefined. In that case, use a different method: plug x = c into the circle equation and solve for y. This calculator requires a slope-intercept form, so vertical lines are not supported directly.
Common Mistakes and Pitfalls
- Using the wrong sign for center coordinates: If the circle center is (2, -3), enter h = 2, k = -3. A common error is entering k = 3, which shifts the circle incorrectly.
- Forgetting to square the radius: The equation uses r², not r. If you enter r = 5 but the equation has r² = 25, the calculator handles it correctly, but manual checks often forget this.
- Mixing up slope and intercept: For a line like y = 2x – 4, m = 2 and b = -4. Entering b = 4 gives a different line.
- Rounding too early: When solving by hand, rounding the discriminant before taking the square root can change the result. Keep full precision until the final step.
- Assuming two intersections: Always check the discriminant. A line can miss the circle entirely, which is a valid outcome.
Limitations and Alternatives
This calculator only works for lines in slope-intercept form (y = mx + b). If your line is in standard form (Ax + By + C = 0), you can rearrange it: y = (-A/B)x – C/B, provided B ≠ 0. For vertical lines (B = 0), you need a different approach. Also, the calculator assumes a real circle with positive radius; entering a negative radius will produce nonsense.
For circles and lines in polar coordinates, or for intersections of two circles, this tool won’t help. Those require different formulas. For most practical purposes, the slope-intercept form covers the majority of textbook and real-world problems.
Frequently Asked Questions
What does the discriminant tell me?
The discriminant (the part under the square root in the quadratic formula) determines the number of intersections. If it’s positive, you get two distinct points. If it’s zero, the line is tangent — exactly one point. If it’s negative, the line doesn’t touch the circle at all.
Can I use this for a vertical line?
No, because a vertical line has undefined slope and cannot be written as y = mx + b. Instead, substitute x = c into the circle equation and solve the resulting quadratic in y. The calculator won’t handle that case.
Why do I get NaN as an answer?
NaN means “not a number” and occurs when the square root of a negative number is attempted. This happens when the discriminant is negative — the line and circle do not intersect. Double-check your inputs for sign errors, but if they’re correct, the line truly misses the circle.
How do I convert a line from standard form to slope-intercept form?
Given Ax + By + C = 0, solve for y: y = (-A/B)x – C/B, as long as B is not zero. For example, 3x + 4y – 12 = 0 becomes y = -0.75x + 3. Then enter m = -0.75 and b = 3.
What if the circle is not centered at the origin?
That’s fine — just enter the actual center coordinates (h, k). The formula works for any center. For example, a circle centered at (2, -1) with radius 4 would use h = 2, k = -1, r = 4.
Can this calculator find the tangent line to a circle at a given point?
Not directly. This calculator finds intersections, not tangents. To find a tangent line, you’d use the radius to the point of tangency (perpendicular to the tangent) and then derive the line equation. That’s a different calculation.
Related
Formula used
in h | Circle center x (h) | - | 0 | 0 in k | Circle center y (k) | - | 0 | 0 in r | Circle radius | - | 5 | 0 in m | Line slope (m) | - | 1 | 0 in b | Line y-intercept (b) | - | 1 | 0 out x1 | First x-intercept | - | (-m*b + sqrt(r^2*(1+m^2) - (b-k)^2 - 2*m*(b-k)*h - m^2*h^2 + r^2*m^2 - r^2*m^2 + 2*m*(b-k)*h + m^2*h^2) + h + m*k - m*b) / (1+m^2) | 4 out y1 | First y-intercept | - | m*x1 + b | 4 out x2 | Second x-intercept | - | (-m*b - sqrt(r^2*(1+m^2) - (b-k)^2 - 2*m*(b-k)*h - m^2*h^2 + r^2*m^2 - r^2*m^2 + 2*m*(b-k)*h + m^2*h^2) + h + m*k - m*b) / (1+m^2) | 4 out y2 | Second y-intercept | - | m*x2 + b | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.