We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maps should not have hard borders, bu rather be folded in toroid.
Calculating distance becomes a bit tricky since the units on opposite sides of the map should actually be close together.
The text was updated successfully, but these errors were encountered:
Actually, this proves to be rather simple. For a grid: sqrt(min(|x1 - x2|, w - |x1 - x2|)^2 + min(|y1 - y2|, h - |y1-y2|)^2)
http://stackoverflow.com/a/2123977
Sorry, something went wrong.
No branches or pull requests
Maps should not have hard borders, bu rather be folded in toroid.
Calculating distance becomes a bit tricky since the units on opposite sides of the map should actually be close together.
The text was updated successfully, but these errors were encountered: