summaryrefslogtreecommitdiff
path: root/geoid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-04-01 15:48:21 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-04-01 15:48:21 +0000
commit3db67120b2e24200222b377ef5a75d10c8eef67d (patch)
tree2fbb2eef7022f8fc25efc1c1d174d95bbcd1d030 /geoid.c
parent3471977cc2ee92e4dfd2d89747bd49c2a0e4069c (diff)
downloadgpsd-3db67120b2e24200222b377ef5a75d10c8eef67d.tar.gz
MacOS compiler fixes. Oleg's fix for the bilinear interpolation.
Geoid-separation code integrated for test but not for production.
Diffstat (limited to 'geoid.c')
-rw-r--r--geoid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/geoid.c b/geoid.c
index f709dd55..e119eb1d 100644
--- a/geoid.c
+++ b/geoid.c
@@ -5,6 +5,7 @@
*/
#include <math.h>
+#include "gpsd.h"
static double bilinear(double x1, double y1, double x2, double y2, double x, double y, double z11, double z12, double z21, double z22)
{
@@ -16,7 +17,7 @@ static double bilinear(double x1, double y1, double x2, double y2, double x, dou
delta=(y2-y1)*(x2-x1);
- return (z22*(y-y1)*(x-x1)+z21*(y2-y)*(x-x1)+z12*(y-y1)*(x2-x)+z11*(y2-y)*(x2-x))/delta;
+ return (z22*(y-y1)*(x-x1)+z12*(y2-y)*(x-x1)+z21*(y-y1)*(x2-x)+z11*(y2-y)*(x2-x))/delta;
}
double wgs84_separation(double lat, double lon)
@@ -63,6 +64,7 @@ double wgs84_separation(double lat, double lon)
);
}
+#ifdef TESTMAIN
#include <stdio.h>
#include <stdlib.h>
@@ -95,4 +97,4 @@ int main(int argc, char **argv)
return 0;
}
-
+#endif /* TESTMAIN */