Breakpoints.
Coefficients of the polynomials. They are reshaped to a 3-D array with the last dimension representing the trailing dimensions of the original coefficient array.
Interpolation axis.
The polynomial between x[i]
and x[i + 1]
is written in the Bernstein polynomial basis:
S = sum(c[a, i] * b(a, k; x) for a in range(k+1)),
where k
is the degree of the polynomial, and:
b(a, k; x) = binom(k, a) * t**a * (1 - t)**(k - a),
with t = (x - x[i]) / (x[i+1] - x[i])
and binom
is the binomial coefficient.
Properties of Bernstein polynomials are well documented in the literature, see for example .
Polynomial coefficients, order :None:None:`k`
and m
intervals
Polynomial breakpoints. Must be sorted in either increasing or decreasing order.
If bool, determines whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs. If 'periodic', periodic extrapolation is used. Default is True.
Interpolation axis. Default is zero.
Piecewise polynomial in terms of coefficients and breakpoints.
PPoly
piecewise polynomials in the power basis
>>> from scipy.interpolate import BPoly
... x = [0, 1]
... c = [[1], [2], [3]]
... bp = BPoly(c, x)
This creates a 2nd order polynomial
$$$$See :
B(x) = 1 \times b_{0, 2}(x) + 2 \times b_{1, 2}(x) + 3 \times b_{2, 2}(x) \\
= 1 \times (1-x)^2 + 2 \times 2 x (1 - x) + 3 \times x^2
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.interpolate._interpolate.PPoly
scipy.interpolate._interpolate.BPoly
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them