colour.algebra.coordinates Package¶
Module Contents¶
-
colour.algebra.coordinates.
cartesian_to_spherical
(a)[source]¶ Transforms given Cartesian coordinates array \(xyz\) to Spherical coordinates array \(\rho\theta\phi\) (radial distance, inclination or elevation and azimuth).
Parameters: a (array_like) – Cartesian coordinates array \(xyz\) to transform. Returns: Spherical coordinates array \(\rho\theta\phi\). Return type: ndarray See also
spherical_to_cartesian()
,cartesian_to_polar()
,polar_to_cartesian()
,cartesian_to_cylindrical()
,cylindrical_to_cartesian()
Examples
>>> a = np.array([3, 1, 6]) >>> cartesian_to_spherical(a) array([ 6.7823299..., 1.0857465..., 0.3217505...])
-
colour.algebra.coordinates.
spherical_to_cartesian
(a)[source]¶ Transforms given Spherical coordinates array \(\rho\theta\phi\) (radial distance, inclination or elevation and azimuth) to Cartesian coordinates array \(xyz\).
Parameters: a (array_like) – Spherical coordinates array \(\rho\theta\phi\) to transform. Returns: Cartesian coordinates array \(xyz\). Return type: ndarray See also
cartesian_to_spherical()
,cartesian_to_polar()
,polar_to_cartesian()
,cartesian_to_cylindrical()
,cylindrical_to_cartesian()
Examples
>>> a = np.array([6.78232998, 1.08574654, 0.32175055]) >>> spherical_to_cartesian(a) array([ 3. , 0.9999999..., 6. ])
-
colour.algebra.coordinates.
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 See also
cartesian_to_spherical()
,spherical_to_cartesian()
,polar_to_cartesian()
,cartesian_to_cylindrical()
,cylindrical_to_cartesian()
Examples
>>> a = np.array([3, 1]) >>> cartesian_to_polar(a) array([ 3.1622776..., 0.3217505...])
-
colour.algebra.coordinates.
polar_to_cartesian
(a)[source]¶ Transforms given Polar coordinates array \(\rho\phi\) (radial coordinate, angular coordinate) to Cartesian coordinates array \(xy\).
Parameters: a (array_like) – Polar coordinates array \(\rho\phi\) to transform. Returns: Cartesian coordinates array \(xy\). Return type: ndarray See also
cartesian_to_spherical()
,spherical_to_cartesian()
,cartesian_to_polar()
,cartesian_to_cylindrical()
,cylindrical_to_cartesian()
Examples
>>> a = np.array([3.16227766, 0.32175055]) >>> polar_to_cartesian(a) array([ 3. , 0.9999999...])
-
colour.algebra.coordinates.
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\). Return type: ndarray See also
cartesian_to_spherical()
,spherical_to_cartesian()
,cartesian_to_polar()
,polar_to_cartesian()
,cylindrical_to_cartesian()
Examples
>>> a = np.array([3, 1, 6]) >>> cartesian_to_cylindrical(a) array([ 3.1622776..., 0.3217505..., 6. ])
-
colour.algebra.coordinates.
cylindrical_to_cartesian
(a)[source]¶ Transforms given Cylindrical coordinates array \(\rho\phi z\) (azimuth, radial distance and height) to Cartesian coordinates array \(xyz\).
Parameters: a (array_like) – Cylindrical coordinates array \(\rho\phi z\) to transform. Returns: Cartesian coordinates array \(xyz\). Return type: ndarray See also
cartesian_to_spherical()
,spherical_to_cartesian()
,cartesian_to_polar()
,polar_to_cartesian()
,cartesian_to_cylindrical()
Examples
>>> a = np.array([3.16227766, 0.32175055, 6.00000000]) >>> cylindrical_to_cartesian(a) array([ 3. , 0.9999999..., 6. ])