Main Content

Spatial Search

Perform triangulation-based searches

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

dsearchnNearest point search
tsearchnN-D closest simplex search
nearestNeighborVertex closest to specified point
neighborsTriangle or tetrahedron neighbors
pointLocationTriangle or tetrahedron enclosing point
barycentricToCartesianConvert coordinates from barycentric to Cartesian
cartesianToBarycentricConvert coordinates from Cartesian to barycentric

Topics