distance method

double distance({
  1. required LngLat location,
})

Implementation

double distance({required LngLat location}) {
  final radianLocation = LngLatRadians.fromLngLat(location: location);
  final currentRadianLocation = LngLatRadians.fromLngLat(location: this);
  return earthRadius *
      MathUtil.inverseHaversine(
        MathUtil.havDistance(
            currentRadianLocation.latitude,
            radianLocation.latitude,
            (currentRadianLocation - radianLocation).longitude),
      );
}