choreo.segm.quad.InterpolateOnSegment#
- InterpolateOnSegment(double[:, ::1] funvals, double[::1] x, (double, double) x_span, QuadTable quad, double eps=1e-14) ndarray #
Interpolates a function given its value on quadrature nodes of an interval.
Lagrange interpolation of a function evaluated at quadrature nodes of an interval.
Given the \(n\) function values \(f_i\), the Lagrange interpolating polynomial is the unique polynomial \(L_f\) of degree \(n-1\) such that \(L_f(x_i)=f_i\).
- Parameters:
funvals (
numpy.ndarray
(shape = (nx, ndim), dtype = np.float64)
) – Function values to be interpolated. See alsoEvalOnNodes()
.x (
numpy.ndarray
(shape = (nx), dtype = np.float64)
) – Array of nodes where the interpolation should be evaluated.x_span (
tuple
(numpy.float64
,numpy.float64
)) – Lower and upper bound of the evaluation interval.quad (
QuadTable
) – Normalized evaluation nodes.eps (
numpy.float64
) – If \(|x-x_i|<\text{eps}\), then the approximation \(l_i(x)=1.\) is used to avoid division by zero. By default1e-14
.
- Returns:
The approximated value of the integral.
- Return type:
numpy.ndarray
(shape = (ndim), dtype = np.float64)