docs: def spherical_to_cartesian(lons, lats, depths=None):
      """
      Return the position vectors (in Cartesian coordinates) of list of spherical
      coordinates.
  
      For equations see: http://mathworld.wolfram.com/SphericalCoordinates.html.
  
      Parameters are components of spherical coordinates in a form of scalars,
      lists or numpy arrays. ``depths`` can be ``None`` in which case it's
      considered zero for all points.
  
      :returns:
          ``numpy.array`` of 3d vectors representing points' coordinates in
          Cartesian space in km. The array has shape `lons.shape + (3,)`.
          In particular, if ``lons`` and ``lats`` are scalars the result is a
          3D vector and if they are vectors the result is a matrix of shape
          (N, 3).
  
      See also :func:`cartesian_to_spherical`.
      """
      phi = numpy.radians(lons)
      theta = numpy.radians(lats)
      if depths is None:
          rr = EARTH_RADIUS
      else:
          rr = EARTH_RADIUS - numpy.array(depths)
      cos_theta_r = rr * numpy.cos(theta)
      try:
          shape = lons.shape
      except AttributeError:  # a list/tuple was passed
          try:
              shape = (len(lons),)
          except TypeError:  # a scalar was passed
              shape = ()
      arr = numpy.zeros(shape + (3,))
      arr[..., 0] = cos_theta_r * numpy.cos(phi)
      arr[..., 1] = cos_theta_r * numpy.sin(phi)
      arr[..., 2] = rr * numpy.sin(theta)
      return arr