Cubic splines interpolate two dimensional data by applying piecewise cubic polynomials that are continuous at the input coordinates (knots). The function itself, the first- and second derivative are continuous at the knots.
Type/Module | Description |
Function or value | Description |
Full Usage:
getFirstDerivative coefficients x
Parameters:
CubicSplineCoef
-
Interpolation functions coefficients.
x : float
-
X value of which the slope should be predicted.
Returns: float
Function that takes an x value and returns the function slope.
|
x values outside of the xValue range are predicted by straight lines defined by the nearest knot!
Example
|
Full Usage:
getSecondDerivative coefficients x
Parameters:
CubicSplineCoef
-
Interpolation functions coefficients.
x : float
-
X value of which the curvature should be predicted.
Returns: float
Function that takes an x value and returns the function curvature.
|
x values outside of the xValue range are predicted by straight lines defined by the nearest knot!
Example
|
Full Usage:
getThirdDerivative coefficients x
Parameters:
CubicSplineCoef
-
Interpolation functions coefficients.
x : float
-
X value of which the y value should be predicted.
Returns: float
Function that takes an x value and returns the function third derivative.
|
x values outside of the xValue range are predicted by straight lines defined by the nearest knot!
Example
|
Full Usage:
interpolate boundaryCondition xValues yValues
Parameters:
BoundaryCondition
-
Condition that defines how slopes and curvatures are defined at the left- and rightmost knot
xValues : Vector<float>
-
Note: Must not contain duplicate x values (use Approximation.regularizeValues to preprocess data!)
yValues : Vector<float>
-
function value at x values
Returns: CubicSplineCoef
Coefficients that define the interpolating function.
|
Computes coefficients for piecewise interpolating splines. In the form of [a0;b0;c0;d0;a1;b1;...;d(n-2)]. where: fn(x) = (an)x^3+(bn)x^2+(cn)x+(dn)
Example
|
|
Interpolates x and y coordinates with given slopes at the knots. Probably makes no sense because slope isnt continuous anymore
|
|
|
Full Usage:
predict coefficients x
Parameters:
CubicSplineCoef
-
Interpolation functions coefficients.
x : float
-
X value of which the y value should be predicted.
Returns: float
Function that takes an x value and returns function value.
|
x values outside of the xValue range are predicted by straight lines defined by the nearest knot!
Example
|
Full Usage:
predictWithinRange coefficients x
Parameters:
CubicSplineCoef
-
Interpolation functions coefficients.
x : float
-
X value of which the y value should be predicted.
Returns: float
Function that takes an x value and returns function value.
|
Returns function that takes x value (that lies within the range of input x values) and predicts the corresponding interpolating y value. Only defined within the range of the given xValues!
Example
|