haversine

HSTB.kluster.fqpr_helpers.haversine(lon1, lat1, lon2, lat2)

Calculate the great circle distance in kilometers between two points on the earth (specified in decimal degrees). Can take numpy arrays as inputs, doing a vectorized calculation of multiple points.

Parameters
  • lon1 (Union[float, int, ndarray]) – longitude in degrees of position one

  • lat1 (Union[float, int, ndarray]) – latitude in degrees of position one

  • lon2 (Union[float, int, ndarray]) – longitude in degrees of position two

  • lat2 (Union[float, int, ndarray]) – latitude in degrees of position two