DEV Community

Discussion on: Radial Search

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

I'd say this is the most inefficient way to do this, but a way none the less, the goal would be to reduce the scope down to a few points, then use euclidian dist. The trouble with checking 10000 points is without scoping, that would be 10000 x 10000 checks. A KDTree helps solve this.

Collapse
 
davidedelpapa profile image
Davide Del Papa • Edited

Ok, in that case you'd better calculate the taxicab distance, which is never lower than the euclidean distance to calculate the bounding box you need, and then compare distances of the points within that box

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

Thank you sir :)