e15190.utilities.geometry.cartesian_to_spherical¶
- e15190.utilities.geometry.cartesian_to_spherical(*args)¶
Convert Cartesian cordinates to spherical coordinates.
- Parameters
args (tuple of scalars, tuple of 1D numpy arrays or a 2D numpy array) –
If the input is a tuple of scalars or a tuple of 1D numpy arrays, they will be interpreted as \((x, y, z)\).
If the input is a 2D numpy array of shape (n_vectors, 3), it will be interpreted as an array of row vectors \((x, y, z)\).
- Returns
spherical_coordinates – The returned ranges are \(r \in [0, \infty)\) for radius, \(\theta \in [0, \pi]\) for polar angle and \(\phi \in (-\pi, \pi]\) for azimuthal angle.
- Return type
same as
args