chaosmagpy.coordinate_utils.cartesian_to_spherical¶
- chaosmagpy.coordinate_utils.cartesian_to_spherical(x, y, z)[source]¶
Convert cartesian coordinates to spherical coordinates.
- Parameters:
- x, y, zfloat or ndarray, shape (…)
- Returns:
- radiusfloat or ndarray, shape (…)
Radius.
- thetafloat or ndarray, shape (…)
Colatitude in degrees \([0^\circ, 180^\circ]\).
- phifloat or ndarray, shape (…)
Longitude in degrees \((-180^\circ,180^\circ]\).