distanceBetween method

double distanceBetween(
  1. double startLatitude,
  2. double startLongitude,
  3. double endLatitude,
  4. double endLongitude, {
  5. GeospatialAlgorithm algorithm = GeospatialAlgorithm.vincenty,
})

Great-circle distance between two coordinates in meters.

algorithm selects the geodetic formula. GeospatialAlgorithm.vincenty (default) is more accurate; GeospatialAlgorithm.haversine is faster.

Implementation

double distanceBetween(
  double startLatitude,
  double startLongitude,
  double endLatitude,
  double endLongitude, {
  GeospatialAlgorithm algorithm = GeospatialAlgorithm.vincenty,
}) => calculateDistance(
  startLatitude,
  startLongitude,
  endLatitude,
  endLongitude,
  algorithm: algorithm,
);