colour.algebra.cartesian_to_cylindrical

colour.algebra.cartesian_to_cylindrical(a)[source]

Transforms given cartesian coordinates array \(xyz\) to cylindrical coordinates array \(\rho\phi z\) (azimuth, radial distance and height).

Parameters

a (array_like) – Cartesian coordinates array \(xyz\) to transform.

Returns

Cylindrical coordinates array \(\rho\phi z\), \(\rho\) is in range [0, +inf], \(\phi\) is in range [-pi, pi] radians i.e. [-180, 180] degrees, \(z\) is in range [0, +inf].

Return type

ndarray

References

[Wik06a], [Wik05b]

Examples

>>> a = np.array([3, 1, 6])
>>> cartesian_to_cylindrical(a)  
array([ 3.1622776...,  0.3217505...,  6.        ])