%% 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)

% Copyright 2020 The MathWorks, Inc.