BasicInterpolators.jl
BasicInterpolators.jl copied to clipboard
Basic (+chebyshev) interpolation recipes in Julia
BasicInterpolators.jl
Interpolation methods with a simple interface
contributions welcome
| Documentation | Status |
|---|---|
Use Julia's package manager to install
julia> ]add BasicInterpolators
Interpolation Methods
One Dimension
- [x] linear
- [x] piecewise cubic
- [x] cubic spline (natural or clamped)
- [x] Chebyshev
- [x] arbitrary order polynomials (Neville's method)
- [x] polynomial coefficients (efficient Vandermonde solver)
- [x] end-point cubic Hermite
Two Dimensions, Regular Grid
- [x] linear
- [x] piecewise cubic
- [x] Chebyshev
N-Dimensions, Scattered Points
- [x] radial basis functions (any choice of function)
- [x] Shepard
Basic Usage
See the tutorial for more complete examples.
using BasicInterpolators, ForwardDiff
#some data to interpolate
x = [-1, 0.5, 2, 3]
y = [1, 3, -0.5, 0]
#a linear interpolation struct
p = LinearInterpolator(x, y)
#interpolate at one point
p(2.5)
#interpolate at lots of points
p.(LinRange(-1, 3, 100))
#compute the derivative dy/dx
ForwardDiff.derivative(p, 1.0)
#make an interpolator that doesn't check boundaries (allows extrapolation)
p = LinearInterpolator(x, y, NoBoundaries())
Other packages
Some notable packages with other/advanced methods:
For a longer list, look here.