docs: def to_polar(self, x, y):
          """
          Return the radius and polar angle in the ellipse coordinate
          system given (x, y) pixel image coordinates.
  
          This function takes care of the different definitions for
          position angle (PA) and polar angle (phi):
  
          .. math::
              -\\pi < PA < \\pi
  
              0 < phi < 2 \\pi
  
          Note that radius can be anything.  The solution is not tied to
          the semimajor axis length, but to the center position and tilt
          angle.
  
          Parameters
          ----------
          x, y : float
              The (x, y) image coordinates.
  
          Returns
          -------
          radius, angle : float
              The ellipse radius and polar angle.
          """
          # We split in between a scalar version and a
          # vectorized version. This is necessary for
          # now so we don't pay a heavy speed penalty
          # that is incurred when using vectorized code.
  
          # The split in two separate functions helps in
          # the profiling analysis: most of the time is
          # spent in the scalar function.
  
          if isinstance(x, int) or isinstance(x, float):
              return self._to_polar_scalar(x, y)
          else:
              return self._to_polar_vectorized(x, y)