src/Lootils/Geo/Earth.php
public function earthRadius($latitude) {
    $radLat = deg2rad($latitude);

    $x = cos($radLat) / $this->earthRadiusSemimajor();
    $y = sin($radLat) / $this->earthRadiusSemiminor();

    return 1 / (sqrt($x * $x + $y * $y));
  }
public function earthRadius($latitude) {
    $radLat = deg2rad($latitude);

    $x = cos($radLat) / $this->earthRadiusSemimajor();
    $y = sin($radLat) / $this->earthRadiusSemiminor();

    return 1 / (sqrt($x * $x + $y * $y));
  }
Get the radius of the Earth at a specific latitude.

@param float $latitude
The latitude at which to get the radius of the Earth.

@return float
The radius of the Earth at this latitude in meters.