I have a problem: I have a lot of particles with given coordinates (x,y). My (x,y) plane is divided into a bunch of squares 32×32. I need a fast way to identify, which particles belongs to which square.
Input data: data(Nx3)=(x1,y1,id1;x2,y2,id2,….) – array with particles coordinates and id's. Also could have array with id's of squares, like: (x1,y1,x2,y2,id#; …)
What I want on output is array out(Nx2) containing id of particle and corresponding square id.
I don't need you to write a code for me. I want just idea -how to do it in the most fast and convinient way. Thanks
Best Answer