Interpolation
High-level interpolation of gridded data using B-splines.
Functions
Interpolations.interpolate
— Functioninterpolate(x, y, BSplineOrder(k))
Interpolate values y
at locations x
using B-splines of order k
.
Grid points x
must be real-valued and are assumed to be in increasing order.
Returns a SplineInterpolation
which can be evaluated at any intermediate point.
See also interpolate!
.
Examples
julia> xs = -1:0.1:1;
julia> ys = cospi.(xs);
julia> itp = interpolate(xs, ys, BSplineOrder(4));
julia> itp(-1)
-1.0
julia> itp(0)
1.0
julia> itp(0.42)
0.2486897676885842
Interpolations.interpolate!
— Functioninterpolate!(I::SplineInterpolation, y::AbstractVector)
Update spline interpolation with new data.
This function allows to reuse a SplineInterpolation
returned by a previous call to interpolate
, using new data on the same locations x
.
See interpolate
for details.
Types
BSplineKit.SplineInterpolations.SplineInterpolation
— TypeSplineInterpolation
Spline interpolation.
This is the type returned by interpolate
. Generally, it should not be directly constructed.
A SplineInterpolation
I
can be evaluated at any point x
using the I(x)
syntax.
It can also be updated with new data on the same data points using interpolate!
.
BSplineKit.SplineInterpolations.spline
— Functionspline(I::SplineInterpolation) -> Spline
Returns the Spline
associated to the interpolation.