Use php to write a method similar to the rapid positioning of x, y Jiugong grid.

if the figure x is less than 30 y and greater than 70, return 1 x less than 30 y, return 2 between 40 and 70, and so on
the first method that comes to mind at present
is to judge the value of each grid
the second method is to judge that the x axis is separated from the left, middle and right, and then to judge the upper, middle and lower Y axis

.

is there a better way to feel that both methods are stupid

Php
Mar.04,2021

divide each lattice width by x, and divide each lattice height by y, you can quickly locate the sitting grid coordinates

.
Menu