(Not recommended) Triangle or tetrahedron enclosing point
pointLocation(DelaunayTri) is not recommended. Use
DelaunayTri is not recommended. Use
Point Location of 2-D Query Points
Create a 2-D Delaunay triangulation for a set of random points.
rng default X = rand(10,2); dt = DelaunayTri(X);
Find the triangles that contain specified query points.
Q = [0.25 0.25; 0.5 0.5]; triids = pointLocation(dt,Q)
triids = 2×1 6 9
Point Location of 3-D Query Points
Create a 3-D Delaunay triangulation for a set of random points.
rng default x = rand(10,1); y = rand(10,1); z = rand(10,1); dt = DelaunayTri(x,y,z);
Find the triangles that contain specified query points and evaluate the barycentric coordinates.
Q = [0.25 0.25 0.25; 0.5 0.5 0.5]; [tetids, bcs] = pointLocation(dt,Q)
tetids = 2×1 NaN 3
bcs = 2×4 NaN NaN NaN NaN 0.3823 0.1739 0.2182 0.2255
DT — Delaunay triangulation representation
Delaunay triangulation representation, specified as a
Q — Query points
Query points, specified as a matrix.
Q is of size
the number of query points and
ndim the dimension of the space where
the points reside.
QZ — Query points (as separate arguments)
Query points, specified as separate column vectors. Specify
QY to give the coordinates of 2-D query points, or specify
QZ to give the
coordinates of 3-D query points.
SI — Indices of enclosing simplex
Indices of enclosing simplex, returned as a column vector.
a vector of length
mpts containing the indices of the enclosing
simplex for each query point.
mpts is the number of query
BC — Barycentric coordinates of query point
Barycentric coordinates of query point, returned as a matrix.
ndim matrix where each row
BC(i,:) represents the barycentric coordinates of query point
Q(i,:) with respect to the enclosing simplex