summaryrefslogtreecommitdiff
path: root/geoid.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-03-31 19:26:53 -0700
committerGary E. Miller <gem@rellim.com>2016-03-31 19:26:53 -0700
commit20fe9920129a8f8090badd5eebf12b22d13de846 (patch)
tree47367e34d203616ad456bafa7ac62f1fa6b314ba /geoid.c
parent9b4c18b947030cf5dc54f9e773ce03e86fda72f3 (diff)
downloadgpsd-20fe9920129a8f8090badd5eebf12b22d13de846.tar.gz
if isnan() climb or speed, reset them to zero.
Diffstat (limited to 'geoid.c')
-rw-r--r--geoid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/geoid.c b/geoid.c
index 7e34a1ed..e2a5df53 100644
--- a/geoid.c
+++ b/geoid.c
@@ -128,7 +128,7 @@ void ecef_to_wgs84fix(struct gps_fix_t *fix, double *separation,
vz * sin(phi);
/* sanity check the climb, 10,000 m/s max will do */
if ( isnan(fix->climb) )
- fix->climb = 9999.9;
+ fix->climb = 0;
else if ( 9999.9 < fix->climb )
fix->climb = 9999.9;
else if ( -9999.9 > fix->speed )
@@ -137,7 +137,7 @@ void ecef_to_wgs84fix(struct gps_fix_t *fix, double *separation,
fix->speed = sqrt(pow(vnorth, 2) + pow(veast, 2));
/* sanity check the speed, 10,000 m/s max will do */
if ( isnan(fix->speed) )
- fix->speed = 9999.9;
+ fix->speed = 0;
else if ( 9999.9 < fix->speed )
fix->speed = 9999.9;
else if ( -9999.9 > fix->speed )