segasai / q3c

PostgreSQL extension for spatial indexing on a sphere
GNU General Public License v2.0
77 stars 27 forks source link

distance near pole #12

Closed fandongwei closed 6 years ago

fandongwei commented 6 years ago

I've test two points' distance near pole using sentence select degrees(q3c_dist(radians(0),radians(90),radians(180),radians(89.9))) the distance should be 0.1 degree, but it returns "179.932445023645" even select degrees(q3c_dist(radians(0),radians(90),radians(180),radians(90))) returns "179.932342092551"

segasai commented 6 years ago

Hi,

All the units q3c uses are in degrees.

select (q3c_dist((0),(90),(180),(89.9))); q3c_dist

0.100000000000001 (1 row)

So it returns a correct result.