I am working on a hexagon tiles game and I have applied a coordination system to it.
There are two types and hexagon tiles pattern, and my one is look like this: Hexagon Tiles Coordination
*please noticed that for some reasons, the x and y axis here are swapped, x is vertical and y is horizontal, please feel free to swap it back if you want.
In this pattern, using (0,0) as center, you can see it actually have 6 directions. I set the right hand side ((0,1) side) is 0 degree, and we have 60, 120, 180, 240, 300, etc. (rotate clockwise or anti-clockwise are both ok, but i use anti-clockwise here)
Say, I have a unit on (0,1), and I want it to move anti-clockwise with (0,0) as the center, that is, move to (1,1). It is easy to view it graphically, but quite no idea how to calculate it by a formula.
This is getting more difficult when the case extended to d2 and d3 (means the distance from center)
Hexagon Coordination rotation - d1 to d3
So, is there any ways that can calculate what is the new coordinates after rotate anti-clockwise by 60 degrees? or for all degrees? Thanks!