Spatial Search
Spatial search is the process of finding specific elements, such as points, edges, triangles, or tetrahedra, within a given space. In MATLAB®, you can perform these types of spatial searches using either a Delaunay triangulation or a general triangulation:
Nearest-neighbor search (also called closest-point search or proximity search) – Given a set of points, find the point that is closer to a given query point than to any other point.
Point-location search (also called point-in-triangle search or point-in-simplex search) – Find the triangle, tetrahedron, or higher-dimensional simplex that contains the query point.
Because these search schemes work for both Delaunay and general triangulations, you can use them even if a modification of the points violates the Delaunay criterion.
While MATLAB supports these search schemes in N dimensions,
exact spatial searches can become computationally expensive beyond 3-D. Consider
approximate alternatives for large problems in up to 10 dimensions.
Functions
dsearchn | Nearest point search |
tsearchn | N-D closest simplex search |
nearestNeighbor | Vertex closest to specified point |
neighbors | Triangle or tetrahedron neighbors |
pointLocation | Triangle or tetrahedron enclosing point |
barycentricToCartesian | Convert coordinates from barycentric to Cartesian |
cartesianToBarycentric | Convert coordinates from Cartesian to barycentric |
Topics
- Nearest-Neighbor Search
Perform a nearest-neighbor search in 2-D, 3-D, and 4-D.
- Point-Location Search
Perform a point-location search in 2-D, 3-D, and 4-D.