coords.Coords.cartesian_to_spherical#
- Coords.cartesian_to_spherical(dir=(0, 1, 2), angle_spec=0.017453292519943295)#
Converts from cartesian to spherical coordinates.
Returns a
Coordswhere the values are the coordinates of the input points in a spherical coordinate system. The three axes of the Coords then correspond to (theta, phi, r).Parameters#
- dir: tuple of ints
A permutation of (0,1,2) specifying how the spherical coordinate system is oriented in the global axes. The last value is the axis of the system; the first two values are the equatorial plane; the first and last value define the meridional zero plane. Make sure to preserve the axes ordering in order to get a right-handed system.
- angle_spec: float, at.DEG or RAD, optional
Multiplication factor for angle coordinates. The default (at.DEG) returns angles in degrees. Use RAD to return angles in radians.
Returns#
- Coords
The spherical coordinates of the input points.
See Also#
spherical_to_cartesian(): conversion from spherical to cartesian coordinates
Examples#