Distances between moving points
in
Contributed Library Questions
•
2 years ago
Hi. I'm working with 10.000 moving points and need to search for the nearest to each given point.
Now this is implemented with two slow nested loops.
Some time ago I saw an example where the whole area had been split in little squares. Then distances between a given point and the closer ones was first calculated just into the square where the given point is. If no neighbors were found the search would have been extended to other neighbor squares. This reduces greatly the number of distance comparisons.
Can somebody help me locate that example? It was probably to illustrate a dedicated library and featured (according to my memories) 8000 white moving points on black background.
Or some alternative code/library to do so?
I read about the nearest neighbor algorithms but life is too short to reinvent the wheel.
Thank you in advance!
Alex
1