colour.algebra.cartesian_to_polar

colour.algebra.cartesian_to_polar(a)[source]

Transforms given Cartesian coordinates array \(xy\) to Polar coordinates array \(\rho\phi\) (radial coordinate, angular coordinate).

Parameters

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

Returns

Polar coordinates array \(\rho\phi\).

Return type

ndarray

References

[Wik06a], [Wik05b]

Examples

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