Re: GPS formulas



Hans-Bernhard Broeker wrote:
Everett M. Greene <mojaveg@xxxxxxxxxxxxxxxxxx> wrote:

Hans-Bernhard Broeker <broeker@xxxxxxxxxxxxxxxxxxxxx> writes:


[...]


The distance between two such points along the earth's surface is then
roughly

arccos(dotproduct(point1, point2))/R


The above formula will cause all sorts of grief for short
distances.


That grief is due to the problem being numerically tricky, though, not
because of the formula being wrong.  The formula cited by the OP will
have very similar problems: differences among longitudes and latitudes
of nearby points will lose up to 5 decimal digits to cancellation (GPS
resolution vs. range), even before any trigonomtric function is
called.


That'a why a plain plane trigonometry formula with latitude correction gives the best results on short tracks. Take one degree to correspond 111.11 km and multiply the east-west (longitude) difference with the cosine of the avreage latitude of the track, then use Pythagoras' theorem for the rest.

--

Tauno Voipio
tauno voipio (at) iki fi

.