4 ms·
If you just want nearest neighbor, I would recommend storing floating point (x, y, z) coordinates, and using Euclidean distance in 3-space. (Or rather, the squa
by jacobolus 8y ago
If you just want nearest neighbor, I would recommend storing floating point (x, y, z) coordinates, and using Euclidean distance in 3-space. (Or rather, the square of distance Δx² + Δy² + Δz²; skip the square root.)
If you want to save storage space / bandwidth, you can use the stereographic projection onto a plane and then cut the precision of the floating-point numbers. Stereographic projection / inverse stereographic projection only requires 1 division per point.
Latitude/longitude is quite an inefficient and cumbersome way of representing points on a sphere, though it’s convenient if navigating using the stars.
- kardos 8y ago> Latitude/longitude is quite an inefficient and cumbersome way of representing points on a sphere Using lat/lon absolves you of storing projection metadata
- jacobolus 8y agohttps://en.wikipedia.org/wiki/Latitude#Geodetic_and_geocentric_latitudes https://en.wikipedia.org/wiki/Latitude#Geodetic_and_geocentr... “The definition must be accompanied with a specification of the ellipsoid.” etc.