galpy.util.coords.rect_to_cyl

galpy.util.coords.rect_to_cyl(X, Y, Z)[source]

Convert from rectangular to cylindrical coordinates

Parameters:
  • X (float or numpy.ndarray) – X coordinate.

  • Y (float or numpy.ndarray) – Y coordinate.

  • Z (float or numpy.ndarray) – Z coordinate.

Returns:

Containing (R,phi,z)

Return type:

numpy.ndarray

Notes

  • 2010-09-24 - Written - Bovy (NYU)

  • 2019-06-21 - Changed such that phi in [-pi,pi] - Bovy (UofT)