colour.algebra.coordinates Package

Module Contents

colour.algebra.coordinates.cartesian_to_spherical(vector)

Transforms given Cartesian coordinates vector to Spherical coordinates.

Parameters:vector (array_like) – Cartesian coordinates vector (x, y, z) to transform.
Returns:Spherical coordinates vector (r, theta, phi).
Return type:ndarray

Examples

>>> vector = np.array([3, 1, 6])
>>> cartesian_to_spherical(vector)  
array([ 6.7823299...,  1.0857465...,  0.3217505...])
colour.algebra.coordinates.spherical_to_cartesian(vector)

Transforms given Spherical coordinates vector to Cartesian coordinates.

Parameters:vector (array_like) – Spherical coordinates vector (r, theta, phi) to transform.
Returns:Cartesian coordinates vector (x, y, z).
Return type:ndarray

Examples

>>> vector = np.array([6.78232998, 1.08574654, 0.32175055])
>>> spherical_to_cartesian(vector)  
array([ 3.        ,  0.9999999...,  6.        ])
colour.algebra.coordinates.cartesian_to_cylindrical(vector)

Transforms given Cartesian coordinates vector to Cylindrical coordinates.

Parameters:vector (array_like) – Cartesian coordinates vector (x, y, z) to transform.
Returns:Cylindrical coordinates vector (z, theta, rho).
Return type:ndarray

Examples

>>> vector = np.array([3, 1, 6])
>>> cartesian_to_cylindrical(vector)  
array([ 6.        ,  0.3217505...,  3.1622776...])
colour.algebra.coordinates.cylindrical_to_cartesian(vector)

Transforms given Cylindrical coordinates vector to Cartesian coordinates.

Parameters:vector (array_like) – Cylindrical coordinates vector (z, theta, rho) to transform.
Returns:Cartesian coordinates vector (x, y, z).
Return type:ndarray

Examples

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