Skip to content

Main content

Hex Even Row Offset to Axial

Convert signed integer hex coordinates between axial and even-row offset convention; floor-compatible parity handles negative coordinates, no geographic projection.

Loading tool…

Description

Convert signed integer hex coordinates between axial and even-row 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-row 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-row offset convention; floor-compatible parity handles negative coordinates, no geographic projection.

How to use the tool and how it works

  1. Enter column, row using the field definitions below.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.q, result.r. Use the ordering, boundary rules and absence conditions described below.

For even-row offset input, return q = column − (row + parity(row))/2 and r = row.1

Input fieldMeaning and unitsAccepted input
columnInteger column under the named offset/doubled convention.A finite safe integer within the operation’s stated bounds.
rowInteger row under the named offset/doubled convention.A finite safe integer within the operation’s stated bounds.
Output fieldInterpretation
resultObject containing the named fields below.
result.qAxial q coordinate; fractional for the pixel inverse operation.
result.rAxial r coordinate; fractional for the pixel inverse operation.
json
{
  "input": {
    "column": 2,
    "row": 1
  },
  "output": {
    "result": {
      "q": 1,
      "r": 1
    }
  }
}

Limitations and assumptions

  • Negative coordinates use normalized parity; changing offset convention changes the axial result.
  • 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

  1. Tool behavior and example: Hex Even Row Offset to Axial — tool.io

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 Row Offset

    Convert signed integer hex coordinates between axial and odd-row offset convention; floor-compatible parity handles negative coordinates, no geographic projection.