1.0.1 • Published 4 years ago

grid-coordinates v1.0.1

Weekly downloads
3
License
CC-BY-NC-SA-3.0
Repository
github
Last release
4 years ago

grid-coordinates

Calculate X, Y coordinates from cell position and grid width.

Usage

Get the coordinates of cell 12 in a grid 6 cells wide:

const gc = require('grid-coordinates');
const coords = gc(12, 6);
console.log(coords); // [ 0, 2 ] i.e [ X, Y ]

License

(C) 2020 P. Hughes. All rights reserved.

Shared under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported license.