Alright, so I'm having a hard time thinking of a way to do this. Perhaps someone here can help!
Here is the problem: I need to figure out a way to use bitwise operations (or any sort of equation) to turn a single number into an x and y that represents an offset spiraling 0,0 (see image).
Related image:
So $f(n) = x$ and $g(n) = y$, for example, would yield something like $f(25) = -2$ and $g(4)= 1$.
I need a way to store those two values within a byte, either through bitwise operations (much like how RGB values are stored and retrieved within an integer) or through some other mathematical equation.
If the numbers need to be repositioned or something, that is fine too.
Any help to point me in the right direction?