original_docstring: 
      [nUVrUV, nUValphaUV, nUVbetaUV] = Cart2SphUV(x,y,z,nUV)
  	
      Returns the dot product between a given unit vector nUV and the unit 
      vectors of the spherical polar coordinate system (r, alpha, beta), 
      evaluated at Cartesian coordinates (x,y,z). Here alpha is
      azimuth angle (angle in radians from the positive x axis, with rotation
      around the positive z axis according to the right-hand screw rule) and
      beta is polar angle (angle in radians from the positive z axis).
      
      It is assumed that x, y and z are all the same size.
      The returned arrays will be the same size as the arguments.
      
docstring: [nUVrUV, nUValphaUV, nUVbetaUV] = Cart2SphUV(x,y,z,nUV)
  Returns the dot product between a given unit vector nUV and the unit
  vectors of the spherical polar coordinate system (r, alpha, beta),
  evaluated at Cartesian coordinates (x,y,z). Here alpha is
  azimuth angle (angle in radians from the positive x axis, with rotation
  around the positive z axis according to the right-hand screw rule) and
  beta is polar angle (angle in radians from the positive z axis).
  
  It is assumed that x, y and z are all the same size.
  The returned arrays will be the same size as the arguments.
docstring_tokens: [ nUVrUV nUValphaUV nUVbetaUV ] = Cart2SphUV ( x y z nUV ) Returns the dot product between a given unit vector nUV and the unit vectors of the spherical polar coordinate system ( r alpha beta ) evaluated at Cartesian coordinates ( x y z ) . Here alpha is azimuth angle ( angle in radians from the positive x axis with rotation around the positive z axis according to the right - hand screw rule ) and beta is polar angle ( angle in radians from the positive z axis ) . It is assumed that x y and z are all the same size . The returned arrays will be the same size as the arguments .
code: def cart2sphUV(x,y,z,nUV):
      '''
      [nUVrUV, nUValphaUV, nUVbetaUV] = Cart2SphUV(x,y,z,nUV)
  	
      Returns the dot product between a given unit vector nUV and the unit 
      vectors of the spherical polar coordinate system (r, alpha, beta), 
      evaluated at Cartesian coordinates (x,y,z). Here alpha is
      azimuth angle (angle in radians from the positive x axis, with rotation
      around the positive z axis according to the right-hand screw rule) and
      beta is polar angle (angle in radians from the positive z axis).
      
      It is assumed that x, y and z are all the same size.
      The returned arrays will be the same size as the arguments.
      '''
      
      r = np.sqrt(x**2 + y**2 + z**2)
      rho = np.sqrt(x**2 + y**2)
      
      nUVrUV = nUV[0] * x / r + nUV[1] * y / r + nUV[2] * z / r
      nUValphaUV = - nUV[0] * y / rho + nUV[1] * x / rho 
      nUVbetaUV = nUV[0] * x * z / (rho * r) + nUV[1] * z * y / (rho * r) - nUV[2] * rho / r
  	
      return nUVrUV, nUValphaUV, nUVbetaUV
code_tokens: def cart2sphUV ( x , y , z , nUV ) : r = np . sqrt ( x ** 2 + y ** 2 + z ** 2 ) rho = np . sqrt ( x ** 2 + y ** 2 ) nUVrUV = nUV [ 0 ] * x / r + nUV [ 1 ] * y / r + nUV [ 2 ] * z / r nUValphaUV = - nUV [ 0 ] * y / rho + nUV [ 1 ] * x / rho nUVbetaUV = nUV [ 0 ] * x * z / ( rho * r ) + nUV [ 1 ] * z * y / ( rho * r ) - nUV [ 2 ] * rho / r return nUVrUV , nUValphaUV , nUVbetaUV
short_docstring: [nUVrUV, nUValphaUV, nUVbetaUV] = Cart2SphUV(x,y,z,nUV)
  Returns the dot product between a given unit vector nUV and the unit
  vectors of the spherical polar coordinate system (r, alpha, beta),
  evaluated at Cartesian coordinates (x,y,z).
short_docstring_tokens: [ nUVrUV nUValphaUV nUVbetaUV ] = Cart2SphUV ( x y z nUV ) Returns the dot product between a given unit vector nUV and the unit vectors of the spherical polar coordinate system ( r alpha beta ) evaluated at Cartesian coordinates ( x y z ) .
comment: '''
      [nUVrUV, nUValphaUV, nUVbetaUV] = Cart2SphUV(x,y,z,nUV)
  	
      Returns the dot product between a given unit vector nUV and the unit 
      vectors of the spherical polar coordinate system (r, alpha, beta), 
      evaluated at Cartesian coordinates (x,y,z). Here alpha is
      azimuth angle (angle in radians from the positive x axis, with rotation
      around the positive z axis according to the right-hand screw rule) and
      beta is polar angle (angle in radians from the positive z axis).
      
      It is assumed that x, y and z are all the same size.
      The returned arrays will be the same size as the arguments.
      '''