Bersaelor / KDTree

Swift implementation of a k-dimensional binary space partitioning tree.
MIT License
153 stars 26 forks source link

AllPoints and kNearest do not give the 'same' results. Am I missing something... #56

Open spicymatt opened 3 years ago

spicymatt commented 3 years ago

hello, When calling allPoints with a radius of R, I get N points. When calling nearestK with a large limit and going through all the returned points, I then check how close those points are from my query. I find M points that are closer than R. The problem is that M > N. In other words, the allPoints query is missing M-N points that are within the radius. If I then call allPoints(within: 2*R), I am expecting to find more points, but I still find the same N points. What am I missing ?

Matthieu

Bersaelor commented 3 years ago

Good question,

would it be possible for you to make a condensed test example we can put in the unit tests?