summaryrefslogtreecommitdiff
path: root/gpsprof
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-07-25 20:34:35 -0700
committerGary E. Miller <gem@rellim.com>2016-07-25 20:34:35 -0700
commita99af857eba37a1d678ac7fbe3067043e2c0e04b (patch)
tree7df015cada5454e5666b1e3852a38525a07dcdeb /gpsprof
parent6dd99c2d630b72062a44d99d4f992e2403eca491 (diff)
downloadgpsd-a99af857eba37a1d678ac7fbe3067043e2c0e04b.tar.gz
Move EarthDistanceSmall() into gps/misc.py
Other programs can use it. The accuracy looks good, not great, but WAY better than EarthDistance() and small angles.
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof16
1 files changed, 0 insertions, 16 deletions
diff --git a/gpsprof b/gpsprof
index 31cbe6bd..9940056c 100755
--- a/gpsprof
+++ b/gpsprof
@@ -20,22 +20,6 @@ import socket
import sys
import time
-def EarthDistanceSmall(c1, c2):
- "Distance in meters between two close points specified in degrees."
- # This calculation is known as an Equirectangular Projection
- # fewer numeric issues for small angles that other methods
- (lat1, lon1) = c1
- (lat2, lon2) = c2
- dlat = lat1 - lat2
- avglat = (lat1 + lat2 ) /2
- dlon = (lon1 - lon2) * math.cos( math.radians( avglat ) )
- # Earth Mean Radius 6371000 meters.
- # one degree lat, average 111.133000
- # at equator 110.567 km
- # at poll 111.699 km
- dist = math.sqrt( dlat * dlat + dlon * dlon) * 111133
- return dist;
-
class Baton(object):
"Ship progress indication to stderr."