Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Perform interpolation in n-dimensional space for irregularly spaced data
ResourceFunction["ScatteredInterpolation"][{pts1→v1,pts2→v2,…},{x1,x2,…}] interpolates values at xi assuming the function take values vi at points ptsi. | |
ResourceFunction["ScatteredInterpolation"][{pts1→v1,pts2→v2,…},{x1,x2,…},p] uses the power parameter p for the weighting. | |
ResourceFunction["ScatteredInterpolation"][{pts1→v1,pts2→v2,…},{x1,x2,…},p,nbspec] uses the neighborhood specification nbspec. | |
ResourceFunction["ScatteredInterpolation"][{{{x1,y1},v1},{{x2,y2},v2},…},…] interpolates data given as position-value pairs. | |
ResourceFunction["ScatteredInterpolation"][{pts1→v1,pts2→v2,…},p,nbspec] represents an operator form that can be applied to the points {x1,x2,…}. |
Find scattered interpolations of a few points in 1D:
In[1]:= |
Out[1]= |
Interpolate in 1D:
In[2]:= |
Out[3]= |
Show the results along with the original points:
In[4]:= |
Out[4]= |
Interpolate in 2D:
In[5]:= |
Out[8]= |
Plot the resulting surface along with the original points:
In[9]:= |
Out[9]= |
Interpolate 5D scattered data:
In[10]:= |
Out[13]= |
Alternatively it can be specified in an operator form:
In[14]:= |
Out[14]= |
The built-in Interpolation function cannot recreate the results from ScatteredInterpolation:
In[20]:= |
Out[29]= |
If a specific radius is given, large gaps in the data might prevent the possibility of interpolation; moreover the function can be discontinuous in some places:
In[30]:= |
Out[31]= |
High p basically gives the value of the nearest point, creating a Voronoi tessellation:
In[32]:= |
Out[33]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License