code: def geodetic2spherical(
      lat,
      lon,
      alt,
      ell: Ellipsoid = None,
      deg: bool = True,
  ) -> tuple:
      """
      point transformation from Geodetic of specified ellipsoid (default WGS-84)
      to geocentric spherical of the same ellipsoid
  
      Parameters
      ----------
  
      lat
             target geodetic latitude
      lon
             target geodetic longitude
      alt
           target altitude above geodetic ellipsoid (meters)
      ell : Ellipsoid, optional
            reference ellipsoid
      deg : bool, optional
            degrees input/output  (False: radians in/out)
  
  
      Returns
      -------
  
      Geocentric spherical (spherical latitude, longitude, radius
  
      lat
             target spherical latitude
      lon
             target longitude
      radius
           target distance to the geocenter (meters)
  
      based on:
      Vermeille, H., 2002. Direct transformation from geocentric coordinates to
      geodetic coordinates. Journal of Geodesy. 76. 451-454.
      doi:10.1007/s00190-002-0273-6
      """
      lat, ell = sanitize(lat, ell, deg)
      if deg:
          lon = radians(lon)
  
      # Pre-compute to avoid repeated trigonometric functions
      sinlat = sin(lat)
      coslat = sqrt(1 - sinlat**2)
  
      # radius of curvature of the prime vertical section
      N = ell.semimajor_axis**2 / hypot(
          ell.semimajor_axis * coslat,
          ell.semiminor_axis * sinlat,
      )
  
      # Instead of computing X and Y, we only compute the projection on the XY
      # plane: xy_projection = sqrt( X**2 + Y**2 )
      xy_projection = (alt + N) * coslat
      z_cartesian = (alt + (1 - ell.eccentricity**2) * N) * sinlat
      radius = hypot(xy_projection, z_cartesian)
      slat = asin(z_cartesian / radius)
  
      if deg:
          slat = degrees(slat)
          lon = degrees(lon)
  
      return slat, lon, radius
  
imports: from __future__ import annotations
  from .ellipsoid import Ellipsoid
  from .mathfun import asin, atan2, cbrt, degrees, hypot, power, radians, sin, sqrt
  from .utils import sanitize
label_desc: Use image node_id 1 for calling a global function with example usage: geodetic2spherical(lat, lon, alt, ell, deg) and returns: slat,  lon,  radius