Find 3 coordinates on 2d wrapping grid where maximum distance to any of the three from any point of the grid is shortest.

83 Views Asked by At

I hope the title is clear enough...

Given a two dimensional square grid of size x.

The grid wraps around so (x+1, x+1) is equal to (0,0)

Given point A(a,a) what are the coordinates of B and C so that the maximum distance from any given point to any of A, B or C is the shortest.

To clarify only the distance to the closest point from any given coordinate of the grid is relevant.


I know that for two points the solution would be B(a + x/2, a + x/2) but can't quite wrap my head around how to approach this problem with 3 locations.