Calculate distance between two x/y coordinates?

前端 未结 4 1141
面向向阳花
面向向阳花 2021-02-05 05:18

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

4条回答
  •  野的像风
    2021-02-05 05:46

    • If/while the distance between x coordinates is larger than half of the grid X size, add grid X size to the smaller x coordinate.
    • Do the same for Y.
    • Then calculate the distance.

提交回复
热议问题