stefankoegl / kdtree

A Python implementation of a kd-tree
ISC License
365 stars 118 forks source link

`KDNode.dist` returns squared distance while `search_nn_dist` requires euclidean distance #53

Open MichaelSuen-thePointer opened 1 year ago

MichaelSuen-thePointer commented 1 year ago

The two lines below, one requires dist to be euclidean distance, and the other requires it to be squared distance: https://github.com/stefankoegl/kdtree/blob/master/kdtree.py#L501 https://github.com/stefankoegl/kdtree/blob/master/kdtree.py#L508

And the best argument is not used https://github.com/stefankoegl/kdtree/blob/master/kdtree.py#L517