Originally posted by Bernd Hesberg
Well, haven't you thought about letting Excel do all that work? The necessary data are just the position of every base (you have them) and a sufficient algorithm. You may try this one
=MAX( ABS( ColumnDifference); ABS( RowDifference))+IF( ABS( ColumnDifference)>ABS( RowDifference); ABS( RowDifference)/2; IF( ABS( ColumnDifference)>ABS( RowDifference)/2; ABS( ColumnDifference)-ABS( RowDifference)/2))
Of course, you need to substitute every occurrence of the variables 'RowDifference' and 'ColumnDifference' by their actual pairs of coordinates.
I haven't checked that for *every* possible combination. So, if there's something wrong with it, please reply.
I'd think it saves a lot of counting. Even better, it can be easily used for any other hex-based map.
Sounds close to what I used. Actually (since I was using Quattro Pro and the formulas wouldn't translate to Excel) what I used was a nested IF statement.
Essentially it was as follows:
(
horizontal is the absolute value of difference between the columns,
vertical is the absolute value of the difference between the rows, and I rounded any calculation result)
If the horizontal was less than ½ the vertical, then the distance is equal to the vertical.
Then if the vertical was 0 or 1, then the distance is equal to the horizontal.
Otherwise, the distance is equal to the horizontal + ½ the vertical.
As I said, every distance I checked worked with this logic, and I didn't find any that didn't, but I didn't check more than a random sample of all possible combinations. I may have time on my hands, but I'm not a masochist!
(btw: I don't have Excel.

)