Created
November 15, 2014 23:19
-
-
Save oliverbooth/0426cd20cb95661e709b to your computer and use it in GitHub Desktop.
Useful calculation to turn INDEX into X/Y-coordinates and vice-versa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| i = x + (y * w) | |
| x = i % w | |
| y = i / w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment