I have a set of 100 random points on an xy plane. I am looking for an algorithm that takes those points and orders them into a 10×10 grid.
Ideally, this would work similar to how fluids fill in a space: given 100 random particles, the fluid would eventually evenly space out into a 10×10 grid.
The first approach I tried was iterating through each grid cell and finding a nearest point, but this led to the end of the grid being filled with points that were part of clusters, as other points filled their closest grid cell.
Thanks