To generate the coordinates of a grid of squares with side ℓ = 1.5, follow these easy steps:
Choose the grid's origin: we place a vertex in the point (0,0).
Choose the number of points in each direction: try with a 4×4 grid.
Start by generating the first row. Fix y=0 and create the points with the formula x = ℓ × i = 1.5 × i, with i going from 0 to 3. You'll get (0,0),(1.5,0),(3,0),(4.5,0).
Generate each new row by adding ℓ to the y coordinate.
Read more