@bockit/hex-round

1.0.1 • Public • Published

Hex Round

Round hex coordinates to their nearest hex. Support cube and axial grid systems.

Logic courtesy of redblobgames hex grid reference

Usage

import { hexRoundAxial, hexRoundCube } from '@bockit/hex-round'

hexRoundAxial(1.1, 1) // [ 1, 1 ]
hexRoundCube(1.1, 1, -2) // [ 1, 1, -2 ]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i @bockit/hex-round

Weekly Downloads

2

Version

1.0.1

License

BSD-3-Clause

Last publish

Collaborators

  • bockit