Skip to content

markmbaum/BasicInterpolators.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BasicInterpolators.jl

downloads

Interpolation methods with a simple interface

contributions welcome

Documentation Status
docs Build Status codecov

Use Julia's package manager to install

julia> ]add BasicInterpolators

Interpolation Methods

One Dimension
  • linear
  • piecewise cubic
  • cubic spline (natural or clamped)
  • Chebyshev
  • arbitrary order polynomials (Neville's method)
  • polynomial coefficients (efficient Vandermonde solver)
  • end-point cubic Hermite
Two Dimensions, Regular Grid
  • linear
  • piecewise cubic
  • Chebyshev
N-Dimensions, Scattered Points
  • radial basis functions (any choice of function)
  • 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:

  1. Interpolations.jl
  2. Dierckx.jl
  3. GridInterpolations.jl
  4. ApproXD.jl
  5. FastChebInterp.jl
  6. ApproxFun.jl

For a longer list, look here.