True when (x, y) is inside a width x height grid.
(x, y)
width
height
Both edges are inclusive of 0 and exclusive of width/height, so a cell exists if and only if 0 <= x < width and 0 <= y < height.
0
0 <= x < width
0 <= y < height
True when
(x, y)is inside awidthxheightgrid.Both edges are inclusive of
0and exclusive ofwidth/height, so a cell exists if and only if0 <= x < widthand0 <= y < height.