# How to find the equidistant middle point for 3+ points on an arbitrary polygon?

Background: This is for an app I'm trying to build around finding the center point between 3 or more people. Between 2 people is pretty simple but was unsure for more than 3.

Edit: from reading the comments, if there is no center - I guess asking for the center point is completely the wrong question. What about then the point where the overall distance traveled by the 3 people as a sum is the minimum?

• For three people, it will be the centre of the circle that passes through the three points. For four or more people, it will not always be possible. E.g. People at (1,0), (0,1), (0,0), (-1,-1). For any three of these people, you can find the point that is equidistant to them all, but the fourth person will not be the same distance from that point. Jan 4, 2016 at 2:46
• Note that if the three points are colinear (along the same line), there is no "circle" that passes through all three. (arguably a line is a deficient circle and the point would be at "infinity") Jan 4, 2016 at 4:03
• @Daryl could have been more discouraging to your ambition: you’ll almost never get a set of four points with the property that such a midpoint exists. Jan 4, 2016 at 4:06
• @Lubin he was rather gentle about letting me down - I now see the errors of my way however Jan 5, 2016 at 4:39
• According to your edit, you're looking for the geometric median. However, the centroid as mentioned by Frentos is much easier to compute and may be sufficient for your application. P.S. the geometric median minimizes the total distance, while the centroid minimizes the total squared distance; minimizing the maximum distance is the smallest enclosing circle problem.
– user856
Jan 5, 2016 at 4:41

As commenters have mentioned, there is no well-defined centre. One useful, easy to calculate 'centre' is the centroid: where the balancing point would be if all the people weighed the same amount and were standing on a weightless plane. If the coordinates of the people are $(x_1, y_1), (x_2, y_n), \cdots , (x_n, y_n)$ then the centroid is at $(\bar x, \bar y) = (\dfrac{x_1+x_2+\cdots+x_n}{n}, \dfrac{y_1+y_2+\cdots+y_n}{n})$.
It also has the advantage that the calculation works for $n=1$ and $n=2$ people.