@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 ]

Package Sidebar

Install

npm i @bockit/hex-round

Weekly Downloads

3

Version

1.0.1

License

BSD-3-Clause

Last publish

Collaborators

  • bockit