5.1. cpforager.utils.ortho_distance

cpforager.utils.ortho_distance(lon_1, lat_1, lon_2, lat_2)

Compute the orthodromic distance in kilometers between (lon_1, lat_1) and (lon_2, lat_2).

Parameters:
  • lon_1 (float) – longitude in degrees of the first position.

  • lat_1 (float) – latitude in degrees of the first position.

  • lon_2 (float) – longitude in degrees of the second position.

  • lat_2 (float) – latitude in degrees of the second position.

Returns:

the distance in kilometers between (lon_1, lat_1) and (lon_2, lat_2).

Return type:

float

Orthodromic distance is computed using the trigonometric haversine formula.