Examples
Basic Examples (2)
Given four input points, find the closest in 2D:
Visualize the closest pair:
Scope (4)
The function can also handle many points:
Visualize the closest pair:
Get the indices, the points, and the distance:
Find the closest points in 3D:
The function can also handle high-dimensional points:
Properties and Relations (2)
The function can be naively implemented by checking all pairs:
The difference is in the speed:
Visualize the difference in speed:
The dimension can exceed the number of points:
Possible Issues (3)
When no points are given a Failure object is returned:
Also a single point is not enough:
For 1D, the coordinate should be between braces:
Like this:
Neat Examples (1)
Check the method against a naive implementation:
Publisher
SHuisman
Related Links
Requirements
Wolfram Language 14.0
(January 2024) or above
Version History
-
1.0.1
– 02 January 2026
-
1.0.0
– 14 April 2025
Related Resources