Description
Convert signed integer hex coordinates between axial and even-column offset convention; floor-compatible parity handles negative coordinates, no geographic projection.
Hexagonal grids can store cells as axial [q,r], parity-based offset or doubled coordinates. Those integer layouts describe the same lattice with different row/column conventions. Drawing cell centers also needs an orientation, origin and center-to-corner radius; those drawing units are separate from lattice coordinates.
Convert signed integer hex coordinates between axial and even-column offset convention; floor-compatible parity handles negative coordinates, no geographic projection.
When to use this tool
Use this tool to convert signed integer hex coordinates between axial and even-column offset convention; floor-compatible parity handles negative coordinates, no geographic projection.
How to use the tool and how it works
- Enter q, r using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.column, result.row. Interpret signs, units, ordering and null values using the rules below.
For integer axial [q,r], keep column = q and set row = r + (q + mod(q,2))/2. The modulo is normalized to 0 or 1, so negative columns use the same even-column convention.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| q | Axial q coordinate, integer except for pixel-center mapping. | Finite safe integer satisfying the stated bounds. |
| r | Axial r coordinate, integer except for pixel-center mapping. | Finite safe integer satisfying the stated bounds. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.column | Resulting integer offset/doubled column under the selected convention. |
| result.row | Resulting integer offset/doubled row under the selected convention. |
{
"input": {
"q": 1,
"r": 2
},
"output": {
"result": {
"column": 1,
"row": 3
}
}
} Limitations and assumptions
- Inputs are integer coordinates within ±1,000,000,000; this is a lattice-layout change with no physical scale.
- Integer lattice inputs are bounded to ±1,000,000,000; the pixel-center operation accepts fractional axial values. Ring/disk radius bounds are stated above. No geographic projection, physical scale or board boundary is inferred.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Keep grid layout, parity convention and drawing orientation consistent. Use coordinate conversion for an existing cell and a separate pathfinding model for obstacles or routes.
References
Similar or alternative tools
- Hex Even Column Offset to Axial
Convert even-column offset coordinates back to axial coordinates.
- Hex Axial Center to Pixel Record
Map supplied fractional axial hex coordinates to Cartesian pixel centers for explicit pointy/flat orientation, circumradius and origin; no geographic units.