is_regular_grid function

Check if x and y positions conforms a regular grid