def _calculate_distance(latlon1, latlon2):
lat1, lon1 = latlon1<EOL>lat2, lon2 = latlon2<EOL>dlon = lon2 - lon1<EOL>dlat = lat2 - lat1<EOL>R = <NUM_LIT>  <EOL>a = np.sin(dlat / <NUM_LIT:2>)**<NUM_LIT:2> + np.cos(lat1) * np.cos(lat2) * (np.sin(dlon / <NUM_LIT:2>))**<NUM_LIT:2><EOL>c = <NUM_LIT:2> * np.pi * R * np.arctan2(np.sqrt(a), np.sqrt(<NUM_LIT:1> - a)) / <NUM_LIT><EOL>return c<EOL>
Calculates the distance between two points on earth.