Skip to main content
1 of 4

Euclidean distante = sqrt (dx * dx + dy * dy), you need to define dx as min(abs(x2-x1),screenwidth-abs(x2-x1)) same thing for dy.