The H3 Core Library uses the following coordinate systems internally.
Discrete hexagon planar grid systems naturally have 3 coordinate axes spaced 120° apart. We refer to such a system as an ijk coordinate system, for the three coordinate axes i, j, and k. A single ijk coordinate triplet is represented in the H3 Core Library using the structure type
Using an ijk coordinate system to address hexagon grid cells provides multiple valid addresses for each cell. Normalizing an ijk address (function
_ijkNormalize) creates a unique address consisting of the minimal positive ijk components; this always results in at most two non-zero components.
The H3 Core Library centers an ijk coordinate system on each face of the icosahedron; the combination of a face number and ijk coordinates on that face's coordinate system is represented using the structure type
Each grid resolution is rotated ~19.1° relative to the next coarser resolution. The rotation alternates between counterclockwise and clockwise at each successive resolution, so that each resolution will have one of two possible orientations: Class II or Class III (using a terminology coined by R. Buckminster Fuller). The base cells, which make up resolution 0, are Class II.
A Hex2d coordinate system is a cartesian coordinate system associated with a specific ijk coordinate system, where:
Hex2d coordinates are represented using the structure type
Algorithms working with hexagons may want to refer to grid coordinates that are not interrupted by base cells or faces. These coordinates have 2 coordinate axes spaced 120° apart, with the coordinates anchored by an origin H3 index.
(0, 0)in the local coordinate space.
Local IJ coordinates are represented using the structure type
CoordIJ and an associated origin