how to convert an array to a 2d coordinates code example Example: js 1d index to 2d coord y = index / width; x = index % width;