spherical_to_cartesian¶
- astropy.coordinates.spherical_to_cartesian(r, lat, lon)[source]¶
Converts spherical polar coordinates to rectangular cartesian coordinates.
Note that the input angles should be in latitude/longitude or elevation/azimuthal form. I.e., the origin is along the equator rather than at the north pole.
Note
This is a low-level function used internally in
astropy.coordinates
. It is provided for users if they really want to use it, but it is recommended that you use theastropy.coordinates
coordinate systems.- Parameters:
- rscalar, numpy:array_like, or
Quantity
The radial coordinate (in the same units as the inputs).
- latscalar, numpy:array_like, or
Quantity
[:ref: ‘angle’] The latitude (in radians if array or scalar)
- lonscalar, numpy:array_like, or
Quantity
[:ref: ‘angle’] The longitude (in radians if array or scalar)
- rscalar, numpy:array_like, or
- Returns:
- x
python:float
orarray
The first cartesian coordinate.
- y
python:float
orarray
The second cartesian coordinate.
- z
python:float
orarray
The third cartesian coordinate.
- x