colour.lagrange_coefficients#

colour.lagrange_coefficients(r: float, n: int = 4) NDArrayFloat[source]#

Compute Lagrange coefficients at specified point \(r\) for polynomial interpolation of degree \(n\).

Parameters:
  • r (float) – Point at which to compute the Lagrange coefficients.

  • n (int) – Degree of the polynomial interpolation. The number of coefficients returned will be \(n + 1\).

Returns:

Array of Lagrange coefficients computed at point \(r\).

Return type:

numpy.ndarray

References

[Fai85], [Wikipedia03a]

Examples

>>> lagrange_coefficients(0.1)
array([ 0.8265,  0.2755, -0.1305,  0.0285])