colour.algebra.spherical_to_cartesian

colour.algebra.spherical_to_cartesian(a)[source]

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

Parameters

a (array_like) – 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

ndarray

References

[Wikipedia06a], [Wikipedia05b]

Examples

>>> a = np.array([6.78232998, 0.48504979, 0.32175055])
>>> spherical_to_cartesian(a)  
array([ 3.0000000...,  0.9999999...,  5.9999999...])