projectionHex = {
let convert = ([x, y]) => [
radius * (2 * (1 + x) + (y % 2)),
radius * Math.sqrt(3) * (1 + y)
];
convert.invert = ([px, py]) => {
const floatY = py / (radius * Math.sqrt(3)) - 1;
const Y = Math.round(floatY);
const floatX = (px / radius - (Y % 2)) / 2 - 1;
const X = Math.round(floatX);
return [X, Y];
};
return convert;
}