code: def gps_distance(lat1, lon1, lat2, lon2):
      '''return distance between two points in meters,
      coordinates are in degrees
      thanks to http://www.movable-type.co.uk/scripts/latlong.html'''
      lat1 = math.radians(lat1)
      lat2 = math.radians(lat2)
      lon1 = math.radians(lon1)
      lon2 = math.radians(lon2)
      dLat = lat2 - lat1
      dLon = lon2 - lon1
  
      a = math.sin(0.5*dLat)**2 + math.sin(0.5*dLon)**2 * math.cos(lat1) * math.cos(lat2)
      c = 2.0 * math.atan2(math.sqrt(a), math.sqrt(1.0-a))
      return radius_of_earth * f gps_distance(lat1, lon1, lat2, lon2):
      '''return distance between two points in meters,
      coordinates are in degrees
      thanks to http://www.movable-type.co.uk/scripts/latlong.html'''
      lat1 = math.radians(lat1)
      lat2 = math.radians(lat2)
      lon1 = math.radians(lon1)
      lon2 = math.radians(lon2)
      dLat = lat2 - lat1
      dLon = lon2 - lon1
  
      a = math.sin(0.5*dLat)**2 + math.sin(0.5*dLon)**2 * math.cos(lat1) * math.cos(lat2)
      c = 2.0 * math.atan2(math.sqrt(a), math.sqrt(1.0-a))
      return radius_of_earth * c
docs: return distance between two points in meters,
      coordinates are in degrees
      thanks to http://www.movable-type.co.uk/scripts/latlong.html