spherical_to_cartesian#
- pygaia.astrometry.vectorastrometry.spherical_to_cartesian(r, phi, theta)#
Convert spherical to Cartesian coordinates. The input can be scalars or 1-dimensional numpy arrays. Note that the angle coordinates follow the astronomical convention of using elevation (declination, latitude) rather than its complement (pi/2-elevation), where the latter is commonly used in the mathematical treatment of spherical coordinates.
- Parameters:
r (float or float array) – Length of input Cartesian vector.
phi (float or float array) – Longitude-like angle (e.g., right ascension, ecliptic longitude) in radians
theta (float or float array) – Latitide-like angle (e.g., declination, ecliptic latitude) in radians
- Returns:
x, y, z – The Cartesian vector components x, y, z
- Return type:
float or float array