colour.polynomial_expansion

colour.polynomial_expansion(a, method='Cheung 2004', **kwargs)[source]

Performs polynomial expansion of given \(a\) array.

Parameters:
  • a (array_like, (3, n)) – \(a\) array to expand.
  • method (unicode, optional) – {‘Cheung 2004’, ‘Finlayson 2015’, ‘Vandermonde’}, Computation method.
Other Parameters:
 
Returns:

Expanded \(a\) array.

Return type:

ndarray, (3, n)

References

[Cheung2004], [Finlayson2015], [Westland2004], [Wikipedia2003e]

Examples

>>> RGB = np.array([0.17224810, 0.09170660, 0.06416938])
>>> polynomial_expansion(RGB)  # doctest: +ELLIPSIS
array([ 0.1722481...,  0.0917066...,  0.0641693...])
>>> polynomial_expansion(RGB, 'Cheung 2004', terms=5)  # doctest: +ELLIPSIS
array([ 0.1722481...,  0.0917066...,  0.0641693...,  0.0010136...,  1...])