radiusAtLatitude function

double radiusAtLatitude(
  1. double phi, {
  2. double er = earthEr,
  3. double fl = earthFl,
})

Radius of the parallel of latitude phi in km.

Implementation

double radiusAtLatitude(double phi,
    {double er = earthEr, double fl = earthFl}) {
  final s = math.sin(phi), c = math.cos(phi);
  return er * c / math.sqrt(1 - (2 - fl) * fl * s * s);
}