# colour.algebra.coordinates.transformations Module¶

## Coordinates System Transformations¶

Defines objects to apply transformations on coordinates systems.

The following transformations are available:

References

colour.algebra.coordinates.transformations.cartesian_to_spherical(a)[source]

Transforms given Cartesian coordinates array to Spherical coordinates.

Parameters: a (array_like) – Cartesian coordinates array (x, y, z) to transform. Spherical coordinates array (r, theta, phi). ndarray

Examples

>>> a = np.array([3, 1, 6])
>>> cartesian_to_spherical(a)
array([ 6.7823299...,  1.0857465...,  0.3217505...])

colour.algebra.coordinates.transformations.spherical_to_cartesian(a)[source]

Transforms given Spherical coordinates array to Cartesian coordinates.

Parameters: a (array_like) – Spherical coordinates array (r, theta, phi) to transform. Cartesian coordinates array (x, y, z). ndarray

Examples

>>> a = np.array([6.78232998, 1.08574654, 0.32175055])
>>> spherical_to_cartesian(a)
array([ 3.        ,  0.9999999...,  6.        ])

colour.algebra.coordinates.transformations.cartesian_to_cylindrical(a)[source]

Transforms given Cartesian coordinates array to Cylindrical coordinates.

Parameters: a (array_like) – Cartesian coordinates array (x, y, z) to transform. Cylindrical coordinates array (z, theta, rho). ndarray

Examples

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

colour.algebra.coordinates.transformations.cylindrical_to_cartesian(a)[source]

Transforms given Cylindrical coordinates array to Cartesian coordinates.

Parameters: a (array_like) – Cylindrical coordinates array (z, theta, rho) to transform. Cartesian coordinates array (x, y, z). ndarray

Examples

>>> a = np.array([6.00000000, 0.32175055, 3.16227766])
>>> cylindrical_to_cartesian(a)
array([ 3.        ,  0.9999999...,  6.        ])