colour.algebra.spherical_to_cartesian#
- colour.algebra.spherical_to_cartesian(a: ArrayLike) NDArrayFloat [source]#
Transform given spherical coordinates array \(\rho\theta\phi\) (radial distance, inclination or elevation and azimuth) to cartesian coordinates array \(xyz\).
- Parameters:
a (ArrayLike) – Spherical coordinates array \(\rho\theta\phi\) to transform, \(\rho\) is in range [0, +inf], \(\theta\) is in range [0, pi] radians, i.e., [0, 180] degrees, and \(\phi\) is in range [-pi, pi] radians, i.e., [-180, 180] degrees.
- Returns:
Cartesian coordinates array \(xyz\).
- Return type:
References
[Wikipedia06a], [Wikipedia05e]
Examples
>>> a = np.array([6.78232998, 0.48504979, 0.32175055]) >>> spherical_to_cartesian(a) array([ 3.0000000..., 0.9999999..., 5.9999999...])