grid-coordinates
v1.0.1
Published
Calculate X, Y coordinates from cell position and grid width.
Downloads
6
Maintainers
Readme
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.