10 ms·
The alternatives are either using the pythagoras algorithm, which only makes sense for short distances (unless you are a flat earth believer) or the haversine a
by jillesvangurp 8y ago
The alternatives are either using the pythagoras algorithm, which only makes sense for short distances (unless you are a flat earth believer) or the haversine algorithm: https://en.wikipedia.org/wiki/Haversine_formula https://en.wikipedia.org/wiki/Haversine_formula. Haversine is fine unless you really need super accurate results. The shorter the distance the less of an issue this is.
If you are doing simple distance searches on a map with small radiuses, use whatever is good enough. I've used pythagoras for this in the past as part of a ranking formula as it is a lot cheaper to do that and it does not have to be super accurate.