summaryrefslogtreecommitdiff
path: root/gps.h
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2010-02-27 23:46:26 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2010-02-27 23:46:26 +0000
commitb17ebd3203edd937b446c1a588e42e78db4772a4 (patch)
tree98f1a121ddea16af6ed03f54e2b34cffe7c0ad76 /gps.h
parent879212380d50d9a7c7b372f5bfd34759be71f84c (diff)
downloadgpsd-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gps.h b/gps.h
index 7a06c15b..5ad4b5be 100644
--- a/gps.h
+++ b/gps.h
@@ -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