Circle–Line Intersection

Drag the orange line endpoints. Watch the perpendicular foot, the half-chord, and the 0/1/2 points update live.

Single test: O(1) Ray vs n circles: O(n) With broad-phase: ~O(log n)
110
Circle (centre C) Line A→B Foot F (perp.) Half-chord / tangent Intersection point

Result

Distance Test & Discriminant

Count = sign of r² − d² (same as the discriminant Δ): d>r → 0, d=r → 1, d<r → 2.

Complexity Reference

OperationTime
distance C→line (count)O(1)
foot + half-chord (points)O(1)
quadratic / discriminantO(1)
ray vs n circles (naive)O(n)
ray vs n circles (BVH)~O(log n)

Log