I don't understand why centroid.m generates a qhullmx error saying the hull is narrow. Here's my vertex set:
[.5 .5 .5;
0 0 0;
.5 0 0;
0 0 .5;
.1667 -.1667 .1667]
It finds centroids for the simplices with vertices at points 1 thru 4, and at points 2 thru 5. Also, points 1 and 5 are clearly on opposite sides of the x-z plane, so there is no overlap between the symplices.
Very nice, thank you!
Was just about to write this myself when I found yours.
If your set of points is not convex you can of course use the convex hull:
centroid(P(unique(convhulln(P)),:))
5
28 Jan 2010
Contour2Area
Gives the area of polygons from the matlab function C=contour(x,y,z) and their centroids.
thanks for this function! but what happens with a concave polyhedron? do you have suggestions on how to calculate the center of gravity of these shapes?
Comment only