Alright, so I'm building a game that uses hexagons for its maps. For my dark and mysterious reasons the world also needs to be split up into "Supertiles" (or Superhexes as I call them in the thread title) composed of nineteen hexes as shown in the picture below.
Assuming the origin tile of (0,0) is the center of a supertile, I'm trying to figure out a formula to calculate whether or not any other particular tile is the center of a supertile. (If no such exists, I can fall back on recursive algorithms to determine it after awhile using "jump towards origin by supertile-centers and see if you can hit 0,0", but I'd love to be able to calculate it directly).
I have the following tables for determining the centers of any NEIGHBORING supertile based on the coordinates for the center of the CURRENT supertile:
(N1 labeled in picture, go around clockwise for N2-6)
If the X-Coordinate is even:
- N1: (+3, +3)
- N2: (-2, +4)
- N3: (-5, 0)
- N4: (-3, -4)
- N5: (+2, -4)
- N6: (+5, -1)
If The X-Coordinate is odd:
- N1: (+3,+4)
- N2: (-2, +4)
- N3: (-5, +1)
- N4: (-3, -3)
- N5: (+2, -4)
- N6: (+5, 0)
[attachment=16836:hex_arrangement.png]
I have not yet found a solution to the problem by internet searches or using my own meager skills with math. If anyone can point me to one or figure it out, I will be eternally thankful. Furthermore if any part of the info above is incorrect or unclear please let me know - my brain hurts a bit, so it wouldn't surprise me.
I'm going to go sit in a corner and look at some pictures of kittens to soothe my brain.