1
$\begingroup$

Say I have this map:

Hex Map with Coordinates

The first two digits on each hex represent the X axis, the last two digits the Y axis, with 60º between both.

How do I calculate the shortest distance between two hexes? E.g. the distance between (01,01) and (07,02) is 6. The distance between (02,08) and (04,04) is 5.

Preferably without a conditional algorithm, of which I've seen a couple... All the coordinates being positive will hopefully make it simpler.

  • 0
    By conditional I mean that I've seen a couple algorythms meant for programming languages; e.g. "if (x>y) then foo; else bar;". If at all possible, I'd like to have a direct formula to calculate the distance.2012-07-16

1 Answers 1

2

Personally, I've just used a piece of string. The hex grid is (typically) 1 inch. Characters can go wherever they want, as long as the distance is less than their movement. How do I measure? I take the string and measure along the side of the map grids.