basic question on how to find mean distance between an interior point and all of the vertex points of the convex hull
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I know how to get the convex hull of a set of 3 dimensional points:
% Create the data.
n = 50;
X = randn(n,3);
% Plot the points.
plot3(X(:,1),X(:,2),X(:,3),'ko','markerfacecolor','k');
% Compute the convex hull.
C = convhulln(X);
I have certain interior base locations and I want to determine the average (mean) distance between the base location and all other points on the vertex of the convex hull. How do I do this easily? Thank you for your time
Andrew
0 comentarios
Respuestas (1)
Laurens Bakker
el 7 de Mzo. de 2012
Hi Andrew,
If you have the Statistics toolbox, use the pdist function to compute the distance between a vector of points and a single point. Otherwise, do it by hand:
P = unique( C, 'rows' );
dist = sqrt(sum( bsxfun(@minus,P,yourBaseLocation) .^ 2, 2 ));
I used Euclidean distance: sqrt(sum( (A - B)^2 ))
Cheers,
Laurens
0 comentarios
Ver también
Categorías
Más información sobre Bounding Regions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!