Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
akhra committed Feb 9, 2014
1 parent aedec67 commit 0bf3d95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HexCoord implements hexagonal grid geometry in C#. The main fork utilizes Unity's Vector2 and Vector3 for position information, but is otherwise platform-agnostic; porting to other C# environments should be trivial.

This is an implementation of Amit Patel's constrained cubic axial coordinates, described at http://www.redblobgames.com/grids/hexagons/. Briefly, it uses two axes labeled q and r. The q axis is equivalent to the x axis of a Cartesian plane; but the r axis is 60 degrees from q, rather than the 90 degrees of a Cartesian y axis. HexCoord deviates from Amit's reference example in one way: the positive r axis extends up and right, rather than down and right.
This is an implementation of [Amit Patel's constrained cubic axial coordinates](http://www.redblobgames.com/grids/hexagons/). Briefly, it uses two axes labeled q and r. The q axis is equivalent to the x axis of a Cartesian plane; but the r axis is 60 degrees from q, rather than the 90 degrees of a Cartesian y axis. HexCoord deviates from Amit's reference example in one way: the positive r axis extends up and right, rather than down and right.

For performance reasons, HexCoord is a struct. Because Unity does not serialize structs, there is also a serializable HexCoordinate class which easily converts to and from HexCoord. Use the class where serialization is needed, and the struct everywhere else.

Built-in operations include:
####Built-in operations include:
- Conversion to and from Unity positions.
- Conversion to and from offset-Cartesian coordinates.
- Hexagonal grid polar coordinates (radius, position on ring).
Expand All @@ -17,4 +17,4 @@ Built-in operations include:
- Vector addition, subtraction and scaling.
- Robust hashing, or so I'm told.

Discussion and modest support at http://www.settworks.com/forum/
Discussion and modest support at http://www.settworks.com/forum/hexcoord

0 comments on commit 0bf3d95

Please sign in to comment.