code: def lambdanu_to_Rz(l,n,ac=5.,Delta=1.):
      
      g = Delta**2 / (1.-ac**2)
      a = g - Delta**2
      r2 = (l + a) * (n + a) / (a - g)
      z2 = (l + g) * (n + g) / (g - a)
      index = (r2 < 0.) * ((n+a) > 0.) * ((n+a) < 1e-10)
      if nu.any(index):
          if isinstance(r2,nu.ndarray): r2[index] = 0.
          else:                         r2        = 0.
      index = (z2 < 0.) * ((n+g) < 0.) * ((n+g) > -1e-10)
      if nu.any(index):
          if isinstance(z2,nu.ndarray): z2[index] = 0.
          else:                         z2        = 0.
      return (nu.sqrt(r2),nu.sqrt(z2))
docs: NAME:
  
          lambdanu_to_Rz
  
      PURPOSE:
  
          calculate galactocentric cylindrical coordinates (R,z)
          from prolate spheroidal coordinates (lambda,nu),
          cf. eq. (2.2) in Dejonghe & de Zeeuw (1988a)
  
      INPUT:
  
          l     - prolate spheroidal coordinate lambda
          n     - prolate spheroidal coordinate nu
          ac    - axis ratio of the coordinate surfaces 
                  (a/c) = sqrt(-a) / sqrt(-g) (default: 5.)
          Delta - focal distance that defines the spheroidal coordinate system (default: 1.)
                  Delta=sqrt(g-a)
  
      OUTPUT:
  
          (R,z)
  
      HISTORY:
  
          2015-02-13 - Written - Trick (MPIA)