summaryrefslogtreecommitdiff
path: root/geoid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-04-07 00:37:56 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-04-07 00:37:56 +0000
commit41cbe4abc4cf687a412e4bafe107d71ec04f8841 (patch)
treed02d3f6d8f9764cb3e24c684385b53388805f2fa /geoid.c
parent67b71a2fd2743deff94a80db3e3d70724876b7f0 (diff)
downloadgpsd-41cbe4abc4cf687a412e4bafe107d71ec04f8841.tar.gz
Apparently I had the sign on the geoid correction wrong.
Diffstat (limited to 'geoid.c')
-rw-r--r--geoid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/geoid.c b/geoid.c
index 891db4d4..37a6bab8 100644
--- a/geoid.c
+++ b/geoid.c
@@ -89,7 +89,7 @@ void ecef_to_wgs84fix(struct gps_fix_t *fix,
h = p / cos(phi) - n;
fix->latitude = phi * RAD_2_DEG;
fix->longitude = lambda * RAD_2_DEG;
- fix->altitude = h + wgs84_separation(fix->latitude, fix->longitude);
+ fix->altitude = h - wgs84_separation(fix->latitude, fix->longitude);
/* velocity computation */
vnorth = -vx*sin(phi)*cos(lambda)-vy*sin(phi)*sin(lambda)+vz*cos(phi);
veast = -vx*sin(lambda)+vy*cos(lambda);