Ellipsoid distance on Earth
johndcook.com
johndcook.com
When they switched computer systems, somehow they switched the method they used to calculate the distances between cities for their frequent flyer program. Before the merger, both companies used the ellipsoid method. During the computer systems cutover, the method suddenly changed to a spherical approximation. They also used an incorrect
The difference resulted in shorting flyers of a few (I think the most I saw was 40) frequent flyer miles per leg. They got caught within a couple days and 'fixed' the 'accidental' change. One of those things they seemed to hope no individual would catch but that over many many flyers would add up to a significant cost savings.
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.
Numpy arrays are much faster than python lists etc for maths and matrix operations, (e.g. multiply this 1000 element vector by 2), which are common in scientific and engineering code.
https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/...
For local distance measuring it is generally better and easier to use a projected coordinates system (where units are meters/miles instead of degrees).
But if you are using a software without GIS functions (excel?) and only have a dataset with lat/long coordinates, then it is easier to use the short formula ;-)
https://geopy.readthedocs.io/en/stable/#module-geopy.distanc...