Skip to content

Main content

Hex Cube Axis Reflection

Reflect integer hex cube coordinates across a named cube axis by swapping the other two components; preserves zero-sum coordinates.

Loading tool…

Description

Reflect integer hex cube coordinates across a named cube axis by swapping the other two components; preserves zero-sum coordinates.

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.

Reflect integer hex cube coordinates across a named cube axis by swapping the other two components; preserves zero-sum coordinates.

When to use this tool

Use this tool to reflect integer hex cube coordinates across a named cube axis by swapping the other two components; preserves zero-sum coordinates.

How to use the tool and how it works

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

Require integer cube coordinates summing to zero, then hold the selected axis fixed and swap the other two components.1

Input fieldMeaning and unitsAccepted input
cubeThree cube components [x, y, z] summing to zero; fractional values are accepted only by the rounding operation.Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
axisExact cube reflection axis: x, y or z.Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies.
Output fieldInterpretation
resultObject containing the named fields below.
result.cubeResulting [x, y, z] cube coordinate with zero component sum.
json
{
  "input": {
    "cube": [
      1,
      -1,
      0
    ],
    "axis": "x"
  },
  "output": {
    "result": {
      "cube": [
        1,
        0,
        -1
      ]
    }
  }
}

Limitations and assumptions

  • The reflection uses cube-coordinate axes rather than a screen-space reflection line supplied by the caller.
  • 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 Cube Axis Reflection — tool.io

Similar or alternative tools

  • Hex Fractional Cube Rounding

    Round zero-sum fractional hex cube coordinates and repair the largest rounding-error component to preserve zero sum; ties repair z then y under the documented strict comparisons.

  • Hex Cube Line Coordinate List

    Enumerate a bounded shortest hex cube line by linear interpolation and deterministic zero-sum rounding, including both endpoints; no obstacles or tie-randomization.