obspy.geodetics.base.locations2degrees
- locations2degrees(lat1, long1, lat2, long2)[source]
Convenience function to calculate the great circle distance between two points on a spherical Earth.
This method uses the Vincenty formula in the special case of a spherical Earth. For more accurate values use the geodesic distance calculations of geopy (https://github.com/geopy/geopy).
- Parameters:
lat1 (float or
numpy.ndarray
) – Latitude(s) of point 1 in degreeslong1 (float or
numpy.ndarray
) – Longitude(s) of point 1 in degreeslat2 (float or
numpy.ndarray
) – Latitude(s) of point 2 in degreeslong2 (float or
numpy.ndarray
) – Longitude(s) of point 2 in degrees
- Return type:
float or
numpy.ndarray
- Returns:
Distance in degrees as a floating point number, or numpy array of element-wise distances in degrees
Example
>>> from obspy.geodetics import locations2degrees >>> locations2degrees(5, 5, 10, 10) 7.03970141917538...