This formula only works for flat surfaces where the meshes in each direction are the same. This is true on a small scale at the equator, but the further you get from the equator to the lines of longitude, the closer you are to each other, and the latitudinal lines are still at the same distance from each other.
For example, from Auckland, one degree of latitude is ~ 111.2 km, and one longitude is 88.8 km. So the grid is not square. Effectively means that from (0,0) it is further (0,1) than (1,0).
The correct solution is to use Apple CLLocation and its getDistanceFrom: (or distanceFromLocation :), which calculates the true distances based on the surface of the sphere (given the projection WGS84, I think).
source
share