spheres.coordinates.xyz_sph¶
-
spheres.coordinates.
xyz_sph
(xyz)[source]¶ Converts cartesian coordinates \((x, y, z)\) to spherical coordinates \((\theta, \phi)\). We use the physicist’s convention:
inclination: \(\theta = \arccos{\frac{z}{\sqrt{x^2 + y^2 + z^2}}} \in [0, \pi]\)azimuth \(\phi = \arctan{\frac{y}{x}} \in [0, 2\pi]\)- Parameters
xyz (list/np.ndarray) – (List of) Cartesian coordinates.
- Returns
sph – (List of) Spherical coordinates.
- Return type
np.ndarray