diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2010-02-27 23:46:26 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2010-02-27 23:46:26 +0000 |
commit | b17ebd3203edd937b446c1a588e42e78db4772a4 (patch) | |
tree | 98f1a121ddea16af6ed03f54e2b34cffe7c0ad76 /gps.h | |
parent | 879212380d50d9a7c7b372f5bfd34759be71f84c (diff) | |
download | gpsd-b17ebd3203edd937b446c1a588e42e78db4772a4.tar.gz |
Use the Vincenty formula rather than the Haversine formula for earth_distance.
Vincenty is much better behaved with small distances. This is a translation of
http://www.movable-type.co.uk/scripts/latlong-vincenty.html
While I'm here, put a couple of WGS84 constants into a header.
Diffstat (limited to 'gps.h')
-rw-r--r-- | gps.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -35,6 +35,9 @@ extern "C" { #define MAXCHANNELS 20 /* maximum GPS channels (*not* satellites!) */ #define GPS_PRNMAX 32 /* above this number are SBAS satellites */ +#define WGS84A 6378137 /* equatorial radius */ +#define WGS84F 298.257223563 /* flattening */ +#define WGS84B 6356752.3142 /* polar radius */ /* * The structure describing an uncertainty volume in kinematic space. * This is what GPSes are meant to produce; all the other info is |