Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find the indices of approximate grid points
ResourceFunction["FindGridIndices"][pts,{i1→{j1,k1},i2→{j2,k2},i3→{j3,k3},…}] finds the grid indices of the points pts given the indices for the is. | |
ResourceFunction["FindGridIndices"][pts,{i1→{j1,k1},i2→{j2,k2},i3→{j3,k3},…},delta] finds the grid indices with a maximum deviation delta in the index. | |
ResourceFunction["FindGridIndices"][pts,{i1→{j1,k1},i2→{j2,k2},i3→{j3,k3},…},delta,max] finds the grid indices with a maximum index distance of max allowed to jump 'gaps'. |
Make a grid of points and figure out the grid-indices:
In[1]:= | ![]() |
Out[3]= | ![]() |
For some given points, and known indices, find all the indices:
In[4]:= | ![]() |
Out[5]= | ![]() |
Given some point and known indices, visualize the configuration:
In[6]:= | ![]() |
Out[7]= | ![]() |
Find the indices and annotate the points with their coordinates shown on top. Note that the maximum distance is used to remove very remote points (i.e. it can't jump big gaps):
In[8]:= | ![]() |
Out[9]= | ![]() |
Create data points in an arc and randomly remove some datapoints:
In[10]:= | ![]() |
Out[11]= | ![]() |
Find the indices with a very small delta and visualize the indices with the color indicating the order:
In[12]:= | ![]() |
Out[13]= | ![]() |
Sometimes the delta has to be increased to capture all points:
In[14]:= | ![]() |
Out[20]= | ![]() |
Increasing the maximum delta gives all the points:
In[21]:= | ![]() |
Out[22]= | ![]() |
With a very large delta one can get bizarre results with duplicate indices:
In[23]:= | ![]() |
Out[29]= | ![]() |
Test whether there are duplicate indices:
In[30]:= | ![]() |
Out[30]= | ![]() |
Wolfram Language 12.3 (May 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License