0

I am Using Haversine Formula to find the great circle distance in my work But I want to know The most Exact formula for small distance like 10 meters only

John Machin
  • 81,303
  • 11
  • 141
  • 189
Ramy hakam
  • 522
  • 1
  • 6
  • 19

2 Answers2

4

Continue using the haversine formula. The [spherical] law of cosines formula is known to be inaccurate at short distances. See https://en.wikipedia.org/wiki/Great-circle_distance ... also this SO question: MySQL WordPress Query Returning a Distance of Zero for Some Records

Community
  • 1
  • 1
John Machin
  • 81,303
  • 11
  • 141
  • 189
0

There are a couple of alternative options.

One is to convert points from geodetic to Cartesian system of coordinates and then use Euclidean distance in space. Relative error due to curvature is about 10^-9 for distances below 1 km and 10^-3 for distances below 1000 km.

Another option is to project locations on plane that is tangent to surface of the Earth and then calculate Euclidean distance on the plane. But this solution will not work near poles and additional care should be taken at 180th meridian. A careful implementation for ellipsoid datum can use just one computation if sine and one computation of square root aside of arithmetic operations, and can potentially be faster than Haversine formula for spherical datum, at the same time being much more accurate.

fdermishin
  • 3,519
  • 3
  • 24
  • 45