From 97b9548cff261e13a5b592d31add94631ff4dbc9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 30 Sep 2009 22:03:11 +0000 Subject: Fix computation of epx and epy from eph. Factor of 1/sqrt(2) has to be applied (on the assumption that epx and epy are equal). --- driver_garmin_txt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'driver_garmin_txt.c') diff --git a/driver_garmin_txt.c b/driver_garmin_txt.c index 13f10881..397d605d 100644 --- a/driver_garmin_txt.c +++ b/driver_garmin_txt.c @@ -378,7 +378,8 @@ gps_mask_t garmintxt_parse(struct gps_device_t *session) do { double eph; if (0 != gar_decode((char *) session->packet.outbuffer+31, 3, "", 1.0, &eph)) break; - session->gpsdata.fix.epx = session->gpsdata.fix.epy = eph * (GPSD_CONFIDENCE/CEP50_SIGMA); + /* eph is a circular error, sqrt(epx**2 + epy**2) */ + session->gpsdata.fix.epx = session->gpsdata.fix.epy = eph * (1/sqrt(2)) * (GPSD_CONFIDENCE/CEP50_SIGMA); mask |= HERR_SET; } while (0); -- cgit v1.2.1