diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2004-09-10 17:06:33 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2004-09-10 17:06:33 +0000 |
commit | 2f127814ff887dd85b3ed510150da4cdf497beeb (patch) | |
tree | 14e453c371bb6e3210b13440bb254af38d43e084 | |
parent | d154b89eb3bd0e0e370a8e005afd450c617f6a17 (diff) | |
download | gpsd-2f127814ff887dd85b3ed510150da4cdf497beeb.tar.gz |
Added MeterOffset().
-rwxr-xr-x | gps.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -301,6 +301,13 @@ def EarthDistance((lat1, lon1), (lat2, lon2)): a = acos((x1*x2 + y1*y2 + z1*z2)/pow(CalcRad((lat1+lat2)/2),2)); return CalcRad((lat1+lat2) / 2) * a +def MeterOffset((lat1, lon1), (lat2, lon2)): + "Return offset in meters of second arg from first." + return ( \ + EarthDistance((lat1, lon1), (lat1, lon2)), + EarthDistance((lat1, lon1), (lat2, lon1)) + ) + if __name__ == '__main__': import sys,readline print "This is the exerciser for the Python gps interface." |