I would like to calculate the distance between two x/y coordinates on the surface of a torus. So, this is a normal grid that has the property that its corners and sides are \'co
for points (x1,y1) and (x2,y2), you need to calculate 4 distances:
and then take the minimum of those.