I have just postdposted a library of hex-grid utilites on CodePlexhex-grid utilities.com here: https://hexgridutilities.codeplex.com/ The
The library includes path-finding (using A-* a la Eric Lippert) and includes utilitesutilities for automated conversion between jagged (termed User) cordinatescoordinates and non-jagged (termed Canonical) coordinates. The path-findingnfinding algorithm allows the step cost for each node to vary both with the entry hex and te traversed hex-side (though the example provided is simpler). Also, elevated field-of-view using shadow-casting is provided, [edit: words removed].
IntMatrix2DIntMatrix2D and IntVector2DIntVector2D are [edit: homogeneous]homogeneous integer implementations of affine2D Graphics Vector and Matrix. The final divide by 2 on the vector applications is to re-normalize the vectors; this could be buried in the IntMatrix2DIntMatrix2D implementation, but then the reason for the 7th argument to the IntMatrix2DIntMatrix2D constructors is less obvious. Note the combined caching and lazy-evaluation of non-current formulations.
The code library mentioned above provides a similarly elegant mechanism for hex-picking (iei.e. identifying the hex selected with a mouse click).
In Canonicalcanonical coordinates, the 6 cardinal direction-vectors are (1,0), (0,1), (1,1) and their inverses for all hexagons, without the assymmetryasymmetry of jagged coordintescoordinates.