Skip to content

Main content

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.

Loading tool…

Description

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

How to use the tool and how it works

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

Convert axial q/r to odd-column offset using column = q and row = r + (q − parity(q))/2.1

Input fieldMeaning and unitsAccepted input
qInteger axial q coordinate.A finite safe integer within the operation’s stated bounds.
rInteger axial r coordinate.A finite safe integer within the operation’s stated bounds.
Output fieldInterpretation
resultObject containing the named fields below.
result.columnInteger offset column under the named parity convention.
result.rowInteger offset row under the named parity convention.
json
{
  "input": {
    "q": 1,
    "r": 2
  },
  "output": {
    "result": {
      "column": 1,
      "row": 2
    }
  }
}

Limitations and assumptions

  • This preserves the named layout convention without scaling or drawing a grid.
  • 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 Axial to Odd Column Offset — tool.io

Similar or alternative tools

  • Hex Odd Column Offset to Axial

    Convert signed integer hex coordinates between axial and odd-column 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.