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 use axial, three-component cube or parity-based offset coordinates. Cube coordinates satisfy x + y + z = 0; axial coordinates use two components. Pixel layouts additionally need orientation, origin and center-to-corner size, which are separate from the integer coordinate convention.
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 column, row using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.q, result.r. Use the ordering, boundary rules and absence conditions described below.
For even-column offset input, return q = column and r = row − (column + parity(column))/2.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| column | Integer column under the named offset/doubled convention. | A finite safe integer within the operation’s stated bounds. |
| row | Integer row under the named offset/doubled convention. | A finite safe integer within the operation’s stated bounds. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.q | Axial q coordinate; fractional for the pixel inverse operation. |
| result.r | Axial r coordinate; fractional for the pixel inverse operation. |
{
"input": {
"column": 1,
"row": 2
},
"output": {
"result": {
"q": 1,
"r": 1
}
}
} Limitations and assumptions
- This is a coordinate-layout conversion, not a physical displacement or latitude/longitude transform.
- Integer layout coordinates are bounded to ±1,000,000,000 where required. Cube components must sum to zero within 1e−8. Pixel coordinates, origin and size must use the same distance units; angular calculations use radians internally.
- Every declared top-level input field is required and unexpected 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 no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Keep coordinate layout, parity convention and drawing orientation consistent. Use an explicit rounding operation to choose an integer cell from fractional coordinates and a separate pathfinding model for obstacles or routes.
References
Similar or alternative tools
- Hex Axial to Even Row Offset
Convert signed integer hex coordinates between axial and even-row offset convention; floor-compatible parity handles negative coordinates, no geographic projection.
- Hex Axial to Odd Column Offset
Convert signed integer hex coordinates between axial and odd-column offset convention; floor-compatible parity handles negative coordinates, no geographic projection.