Questions tagged [nearest]
Questions on the usage of Nearest and creating a custom distance function for it; also on NearestNeighborGraph, RegionNearest, GeoNearest and related concepts.
59 questions
3 votes
1 answer
172 views
Nearest without element itself
Is there a smart way to get nearest (given number num to given element elem) elements of list, except element itself? This works ...
1 vote
1 answer
102 views
Problem with RegionNearest?
Consider the following region: ...
0 votes
0 answers
107 views
Compilable analog of Nearest?
Is there any analog of Nearest that is compilable? ...
1 vote
1 answer
123 views
Nearest inside Minimize
How to use Nearest inside Minimize? The following returns errors but if # - {a, b} is ...
1 vote
1 answer
102 views
`FindMinimum` can't evaluate `Nearest` numerically
I'm trying to use Nearest as a function to minimize over: a toy example is ...
2 votes
1 answer
90 views
How to predict number from a set of data?
I have 2 sets of data. For example, ...
6 votes
1 answer
416 views
Fastest Way to Find nearest indices between two sorted lists
I have a sorted list of floats of length n and an n x n list of lists, where each nested ...
1 vote
1 answer
125 views
Issue with using complexplot with Nearest
I have been trying to create a certain fractal with Mathematica but the main issue is that if I try and do something like ...
2 votes
2 answers
202 views
Finding the minimal distance of a point from an interpolated function
I have an interpolating parametric function (solution of a set of differential equations) and I have an external point. I would like to find the minimal distance between this point and the ...
4 votes
2 answers
163 views
Selecting the Nearest First
Imagine I have the following list ...
1 vote
1 answer
300 views
Finding the smallest bounding simplex [closed]
I would like to find the subset of points from a set of d-dimensional points that defines the smallest bounding simplex around a given point. For example, given a set of 3-dimensional points S1 and ...
0 votes
1 answer
115 views
How to obtain the grouped separate line curves from the disorder data?
The sample point data and codes are listed as following. The point-image tells us that the data can be divided into nine groups. However, why are they divided into two groups by ...
3 votes
1 answer
224 views
How do I create an STL file from nearest neighbour graph edges?
I'm trying to figure out to deal with (and design) .stl files within Mathematica. As an example, I would like to generate a FCC lattice without the atoms (but connecting all nearest neighbours), and ...
7 votes
2 answers
274 views
Why does Nearest not return both equally distant values?
Define the following three vectors: a = {0., 0., 0.}; b = {-0.5`, 0.4330127018922193`, 0.25`}; c = {-0.5`, 0.`, 0.`}; Note that the distance from a to c is the ...
1 vote
2 answers
288 views
How to find the shortest distance between two regions?
I need to find the shortest distance between the two regions and the two points of the shortest distance, but the following code cannot achieve this requirement: ...