intersectCircle

open override fun intersectCircle(center: P, radius: Double): Intersection2D<P>(source)

Intersects a line and a circle. Radius must be positive. Intersection is performed by plugging the line equation in the circle equation and solving the resulting quadratic equation. Circle equation: (x - center.x)^2 + (y - center.y)^2 = r^2. Line equation: y = slope * x + yIntercept unless isVertical, x = xIntercept otherwise.