colour.algebra.cartesian_to_cylindrical#

colour.algebra.cartesian_to_cylindrical(a: ArrayLike) numpy.ndarray[source]#

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

Parameters

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

numpy.ndarray

References

[Wikipedia06a], [Wikipedia05e]

Examples

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