colour.algebra.cartesian_to_spherical

colour.algebra.cartesian_to_spherical(a)[source]

Transforms given Cartesian coordinates array \(xyz\) to Spherical coordinates array \(\rho\theta\phi\) (radial distance, inclination or elevation and azimuth).

Parameters:a (array_like) – Cartesian coordinates array \(xyz\) to transform.
Returns:Spherical coordinates array \(\rho\theta\phi\).
Return type:ndarray

References

[Wik06a], [Wik05b]

Examples

>>> a = np.array([3, 1, 6])
>>> cartesian_to_spherical(a)  # doctest: +ELLIPSIS
array([ 6.7823299...,  1.0857465...,  0.3217505...])