The KDtree uses x2 + y2 <= r**2. For very small x,y and r you can get issues. Should we be using float64.hypot as in rust.geo?
import numpy as np
from geoindex_rs import kdtree as kd
e = 10**(-308)
# Three points: (0, 2), (1, 3), (2, 4)
x = np.arange(0, 3)*e
y = np.arange(2, 5)*e
# When creating the builder, the total number of items must be passed
builder = kd.KDTreeBuilder(3)
# Add the points to the builder
builder.add(x, y)
# Consume the builder (sorting the index) and create the KDTree.
tree = builder.finish()
# Search within this bounding box:
results = kd.within(tree,qx=0,qy=0,r=e)
(np.hypot(x,y) < e), results.to_numpy()
The KDtree uses x2 + y2 <= r**2. For very small x,y and r you can get issues. Should we be using float64.hypot as in rust.geo?