Skip to content

Commit

Permalink
Added tolerance of 0.001 to 'inhull.m'
Browse files Browse the repository at this point in the history
This will fix a few issues...
  • Loading branch information
hyongju committed Nov 4, 2016
1 parent 969b69d commit 5fab5f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demo.m
Expand Up @@ -6,12 +6,13 @@
n = 200; % number of points
m = 20; % number of boundary point-candidates
d = 3; % dimension of the space
tol = 0.001; % tolerance value used in "inhull.m" (larger value high precision, possible numerical error)
pos0 = rand(n,d); % generate random points
bnd0 = rand(m,d); % generate boundary point-candidates
K = convhull(bnd0);
bnd_pnts = bnd0(K,:); % take boundary points from vertices of convex polytope formed with the boundary point-candidates
%% take points that are in the boundary convex polytope
in = inhull(pos0,bnd0);
in = inhull(pos0,bnd0,[],tol);
% inhull.m is written by John D'Errico that efficiently check if points are
% inside a convex hull in n dimensions
% We use the function to choose points that are inside the defined boundary
Expand Down

0 comments on commit 5fab5f3

Please sign in to comment.