x y from 1 d array code example Example: js 1d index to 2d coord y = index / width; x = index % width;