Follow up to Rosetta Code task-Total circles area.
Given a selection of points as Cartesian x,y coordinates, find the smallest circle that can contain them all.
One point is enclosed of course by a circle of radius zero!
Two points will be at opposite ends of a diameter.
Three points define a unique circle.
Four or more points MAY be three on the rim and the rest inside, but in theory an infinite number of points could lie exactly on one circle!
-
A guaranteed method is to take the points three at a time in all possible combinations ( 1 and 2-point cases are trivial) and see if the resulting circles include all the others. Boring but straightforward.
I draw the successive attempts, changing colour when the first point is reached, or very close. At the end of a suitable time, I redraw, showing just the points and the grid.
I start with a circle suitably 'centred' and of radius big enough to include all the points within itself. I then progressively shrink it until it touches one of the further-out points. I then dither the centre to see if better approximations can be made, stopping on encountering a second. The intention is to continue this to all possible points.
Examples of the present form of data entry, calculation and results.
-