The Problem:
Given n circles with radii r1 ... rn and positions p1 ... pn. The algorithm have to find radius and center of the circle with the smallest radius containing all n circles. Position and radius of circles are fixed, so they can't be moved.
Structure of circle can looks like this:
Circle{
position: Vector2,
radius: Float
}
Input values: [c1 ... cn] (c - circle)
Output value: c
Image examples:
My thoughts:
I can draw the smallest circle with contain n circles if I find distance of the farthest 2 points and put center on the half ot this line, but there is posibility that the distance beetwen other circles and the center of main circle is farther than half of distance between the farthest 2 points.
So, I use this knowledge to find the farthest distance beetwen the center of main circle and third circle. When the distance is further than radius of main circle I know I have to find a center of three circles.
The problem start there. How can I find it?
I was thinking about finding the largest triangle possible using this three circles and than center of this, but there is problem with finding points position of this triangle. I tied a lot of different methods, but I can't find the heart of the problem.
That's why I'm here for some tips or solution. Maybe my way of thinking is correct, but there is much better solution. I would like to find it with you :)