haversine

nsb2.core.atmosphere.haversine(delta_lon, lat1, lat2)[source]

Angular distance between two points on a sphere.

Parameters:
  • delta_lon (array_like) – Difference in longitude, in radians.

  • lat1 (array_like) – Latitudes of the two points, in radians. Shapes must be mutually broadcastable with delta_lon.

  • lat2 (array_like) – Latitudes of the two points, in radians. Shapes must be mutually broadcastable with delta_lon.

Returns:

Angular separation in radians, in [0, pi].

Return type:

numpy.ndarray

Examples

>>> import numpy as np
>>> round(float(np.degrees(haversine(np.radians(90.0), 0.0, 0.0))), 6)
90.0