Hex distance calculation

Many years ago a friend of mine developed a distance calculation for a hex grid. This is for a column based grid, rather than the row based used in the course, so the calculations would need to be checked to make sure they work, but I think it should be fine.

The comments can be used in Excel to validate the results: X1, Y1 would be a.x, a.z in the code.

image

Privacy & Terms