code: def calc_radius(latitude, ellipsoid='WGS84'):
      
      ellipsoids = {
          'Airy (1830)': (6377.563, 6356.257),  # Ordnance Survey default
          'Bessel': (6377.397, 6356.079),
          'Clarke (1880)': (6378.249145, 6356.51486955),
          'FAI sphere': (6371, 6371),  # Idealised
          'GRS-67': (6378.160, 6356.775),
          'International': (6378.388, 6356.912),
          'Krasovsky': (6378.245, 6356.863),
          'NAD27': (6378.206, 6356.584),
          'WGS66': (6378.145, 6356.758),
          'WGS72': (6378.135, 6356.751),
          'WGS84': (6378.137, 6356.752),  # GPS default
      }
  
      # Equatorial radius, polar radius
      major, minor = ellipsoids[ellipsoid]
      # eccentricity of the ellipsoid
      eccentricity = 1 - (minor ** 2 / major ** 2)
  
      sl = math.sin(math.radians(latitude))
      return (major * (1 - eccentricity)) / (1 - eccentricity * sl ** 2) ** 1.5
docs: Calculate earth radius for a given latitude.
  
      This function is most useful when dealing with datasets that are very
      localised and require the accuracy of an ellipsoid model without the
      complexity of code necessary to actually use one.  The results are meant to
      be used as a :data:`BODY_RADIUS` replacement when the simple geocentric
      value is not good enough.
  
      The original use for ``calc_radius`` is to set a more accurate radius value
      for use with trigpointing databases that are keyed on the OSGB36 datum, but
      it has been expanded to cover other ellipsoids.
  
      Args:
          latitude (float): Latitude to calculate earth radius for
          ellipsoid (tuple of float): Ellipsoid model to use for calculation
  
      Returns:
          float: Approximated Earth radius at the given latitude