code: public static double distance(@NonNull Point point1, @NonNull Point point2,
                                  @NonNull @TurfConstants.TurfUnitCriteria String units) {
      double difLat = degreesToRadians((point2.latitude() - point1.latitude()));
      double difLon = degreesToRadians((point2.longitude() - point1.longitude()));
      double lat1 = degreesToRadians(point1.latitude());
      double lat2 = degreesToRadians(point2.latitude());
  
      double value = Math.pow(Math.sin(difLat / 2), 2)
        + Math.pow(Math.sin(difLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);
  
      return TurfConversion.radiansToLength(
        2 * Math.atan2(Math.sqrt(value), Math.sqrt(1 - value)), units);
    }
docs: Calculates the distance between two points in degress, radians, miles, or kilometers. This
  uses the Haversine formula to account for global curvature.
  
  @param point1 first point used for calculating the bearing
  @param point2 second point used for calculating the bearing
  @param units  one of the units found inside {@link TurfConstants.TurfUnitCriteria}
  @return distance between the two points in kilometers
  @see <a href="http://turfjs.org/docs/#distance">Turf distance documentation</a>
  @since 1.2.0