Amit’s Thoughts on Grids
www-cs-students.stanford.edu
www-cs-students.stanford.edu
I found that keeping the hex coordinates as close as possible to the square coordinates that your GUI library uses makes things easier.
Atleast in Java ( and therefore in Scala, Clojure etc), the data-structure of choice is a general path, and all of those algorithms have built-in implementations, mostly on Path2D or other concretes. Also, instead of dealing with squares, hexagons & triangles separately... a square is just 2 isosceles triangles, and a hex is 6 equilateral triangles. So if you have a Triangle2D class extending Path2D, you get all of the algorithms and the you can handle all 3 face types. The transformation between cooordinate systems is handled by affine transforms
Path2D: http://docs.oracle.com/javase/6/docs/api/java/awt/geom/Path2...
AffineTransform: http://docs.oracle.com/javase/6/docs/api/java/awt/geom/Affin...