def wgs84_distance(lat1, lon1, lat2, lon2):
dLat = math.radians(lat2 - lat1)<EOL>dLon = math.radians(lon2 - lon1)<EOL>a = (math.sin(dLat / <NUM_LIT:2>) * math.sin(dLat / <NUM_LIT:2>) +<EOL>math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) *<EOL>math.sin(dLon / <NUM_LIT:2>) * math.sin(dLon / <NUM_LIT:2>))<EOL>c = <NUM_LIT:2> * math.atan2(math.sqrt(a), math.sqrt(<NUM_LIT:1> - a))<EOL>d = EARTH_RADIUS * c<EOL>return d<EOL>
Distance (in meters) between two points in WGS84 coord system.