Skip to content

Main content

Hex Corner Coordinate List

Enumerate six Cartesian regular-hex corners at an explicit center and circumradius; angle zero for flat, thirty degrees for pointy, mathematical positive-y coordinates.

Loading tool…

Description

Enumerate six Cartesian regular-hex corners at an explicit center and circumradius; angle zero for flat, thirty degrees for pointy, mathematical positive-y 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.

Enumerate six Cartesian regular-hex corners at an explicit center and circumradius; angle zero for flat, thirty degrees for pointy, mathematical positive-y coordinates.

When to use this tool

Use this tool to enumerate six Cartesian regular-hex corners at an explicit center and circumradius; angle zero for flat, thirty degrees for pointy, mathematical positive-y coordinates.

How to use the tool and how it works

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

For six angles separated by pi/3, starting at pi/6 for pointy or zero for flat-top, add size × [cos(angle), sin(angle)] to center.1

Input fieldMeaning and unitsAccepted input
centerHex center [x, y], in the same units as size.Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
sizePositive center-to-corner radius, not edge-to-edge diameter.A finite number satisfying the operation’s stated comparisons.
pointyTrue selects pointy-top formulas; false selects flat-top formulas.A boolean true or false.
Output fieldInterpretation
resultObject containing the named fields below.
result.cornersSix [x, y] corner points in the angular order stated above.
json
{
  "input": {
    "center": [
      0,
      0
    ],
    "size": 1,
    "pointy": false
  },
  "output": {
    "result": {
      "corners": [
        [
          1,
          0
        ],
        [
          0.5000000000000001,
          0.8660254037844386
        ],
        [
          -0.4999999999999998,
          0.8660254037844387
        ],
        [
          -1,
          1.2246467991473532e-16
        ],
        [
          -0.5000000000000004,
          -0.8660254037844384
        ],
        [
          0.5000000000000001,
          -0.8660254037844386
        ]
      ]
    }
  }
}

Limitations and assumptions

  • Size is center-to-corner distance in the same units as center; tiny floating-point remnants may appear at nominally zero components.
  • 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 Corner Coordinate List — tool.io

Similar or alternative tools

  • 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.

  • Hex Doubled Coordinate Axial Parser

    Invert doubled hex coordinates only when column-row parity agrees; odd parity is invalid lattice evidence, not rounded silently.