metersPerLongitude static method

double metersPerLongitude(
  1. double latitude
)

Number of meters per degree longitude at the given latitude.

While the distance between rings of latitude remains constant all over the Earth, rings of longitude stretch as you near the equator, and come to a single point at the poles. For that reason, we need to calculate this number based on your current latitude.

Source: https://stackoverflow.com/a/39540339/9392211

Implementation

static double metersPerLongitude(double latitude) =>
  40075 * cos(latitude * radiansPerDegree ) / 360 * 1000;