Monday, May 4, 2015

GPS Calculation Methods

What Method Does Garmin Use to Calculate Distance ?

Edward Sargisson, at Trail Hunger, concludes that Garmin devices do not use the 3d slope distance when reporting distances, but rather the distance at sea level.

Calculation of the Distance Between 2 Points on the Surface of a Great Sphere - the Haversine Formula

This can be achieved using the Haversine Formula, here is a javascript implementation from Movable Type Ltd:

var Bx = Math.cos2) * Math.cos21);
var By = Math.cos2) * Math.sin21);
var φ3 = Math.atan2(Math.sin1) + Math.sin2), Math.sqrt( (Math.cos1)+Bx)*(Math.cos1)+Bx) + By*By ) );
var λ3 = λ1 + Math.atan2(By, Math.cos1) + Bx);

See Also

R. W. Sinnott, "Virtues of the Haversine".  Sky and Telescope, vol 68, no 2, 1984

No comments:

Post a Comment

comment: