summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-22 01:38:51 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-22 01:38:51 +0000
commit51fc3a79ff59cb96375c0a84106b1225192b342c (patch)
treed79844927d9a946e8a2193a067d978d856c9ed0c
parente0d0dbb182ea7b141d78c0cffde81faf994302c7 (diff)
downloadgpsd-51fc3a79ff59cb96375c0a84106b1225192b342c.tar.gz
hdop = sqrt(xdop**2 + ydop**2);
therefore, if all we have is hdop, we should set xdop = ydop = hdop/sqrt(2).
-rw-r--r--libgps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgps.c b/libgps.c
index 1642cd24..9c0443bf 100644
--- a/libgps.c
+++ b/libgps.c
@@ -175,8 +175,8 @@ int gps_unpack(char *buf, struct gps_data_t *gpsdata)
#define DEFAULT(val) (val[0] == '?') ? NAN : atof(val)
/*@ +floatdouble @*/
gpsdata->epe = DEFAULT(epe);
- gpsdata->fix.epx = DEFAULT(eph);
- gpsdata->fix.epy = DEFAULT(eph);
+ gpsdata->fix.epx = DEFAULT(eph)/sqrt(2);
+ gpsdata->fix.epy = DEFAULT(eph)/sqrt(2);
gpsdata->fix.epv = DEFAULT(epv);
/*@ -floatdouble @*/
#undef DEFAULT