Reputation: 31
My requirement is to find the point closest to three circles. So lets say the three circles are C1, C2, C3. I want to find the point in the space such that the SUM of its distance from C1, C2 and C3 is MINIMUM.
The distance of a given point from a circle is the distance of the given point from the point that lies on the circle and is intersection of the circle with the line joining the given point with the center of the circle.
Is there a simple logic of find such a point?
Upvotes: 1
Views: 720
Reputation: 60868
Unless one of the distances will be zero, the circle radii are irrelevant: the sum of the distances to the circles will be the sum of the distances to the centers minus the sum of the radii. So in effect you are asking for the geometric median of the circle centers. You might want to iteratively compute an approximation. Or you make use of the fact that you have three circles, in which case the median is the Fermat point of the triangle formed by their centers.
If the point constructed as above lies within one of the circles, then you can move towards that circle while decreasing the sum. So you'd have to consider all the points on that given circle, which you can express as a one-parameter family. You could then compute the distance as a function of that parameter, and the derivative of the resulting formula, and setting that equal to zero will give the optimal solution for this case.
Upvotes: 2