Scattered Data as a First Class Citizen
Interpolate and differentiate directly on scattered point clouds. Local stencils from k-nearest neighbors scale to large problems.
Radial basis functions for operators, machine learning, and beyond.
using RadialBasisFunctions, StaticArrays
# Scattered data
points = [SVector{2}(rand(2)) for _ in 1:500]
f(x) = sin(4x[1]) * cos(3x[2])
values = f.(points)
# Interpolation
interp = Interpolator(points, values)
interp(SVector(0.5, 0.5))
# Differential operators on scattered data
∇² = laplacian(points)
∇ = gradient(points)
∂x = partial(points, 1, 1) # ∂/∂x₁
∂²y = partial(points, 2, 2) # ∂²/∂x₂²
∇²(values) # apply to data
∇(values) # Nx2 matrix
# Combine operators
mixed = ∂x + ∂²y # operator algebra
# Transfer data between point sets
target = [SVector{2}(rand(2)) for _ in 1:1000]
rg = regrid(points, target)
rg(values) # interpolated onto target| Type | Formula | Best For |
|---|---|---|
| Polyharmonic Spline (PHS) | General purpose, no shape parameter tuning | |
| Inverse Multiquadric (IMQ) | Smooth interpolation with tunable accuracy | |
| Gaussian | Infinitely smooth functions |
using Pkg
Pkg.add("RadialBasisFunctions")Requires Julia 1.10 or later.