1.0.1 • Published 10 years ago

@bockit/hex-round v1.0.1

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
10 years ago

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 ]