geokdtree icon indicating copy to clipboard operation
geokdtree copied to clipboard

same coordinates return NaN instead of expected 0

Open murtali opened this issue 5 years ago • 0 comments

hi -- first wanted to thank you on the great gem --

not sure if this is intended behavior but had a NaN parse error come up when pushing data out as JSON -- found out the error is coming from the following situation:

distance = Geokdtree::Tree.geo_distance([37.993892, -122.136441], [37.993892, -122.136441])

when the coordinates are the same, distance returns NaN instead of what I'd expect to be 0

murtali avatar Apr 27 '20 16:04 murtali