Suppose that I have a closed and convex polyhedron given by the following vertices:
$(0.5, 0.5, 0), (0.25, 0.5, 0.25), (0.75, 0, 0.25), (0.75, 0.25, 0)$
Unless I'm wrong, the barycentre (which is the geometrical centroid) shall be computed by averaging the the vertices, which in this case yields the following vector:
$c=(9/16,5/16,1/8)$
I'm running this simple line on Mathematica:
RegionCentroid[Polygon[{{0.5, 0.5, 0}, {0.25, 0.5, 0.25}, {0.75, 0, 0.25}, {0.75, 0.25, 0}}]]
Which delivers the following vector as the region centroid:
$c^\prime = (0.555556,0.305556,0.138889)$
Of course, $c \neq c^\prime$. Can anybody please tell me what I am missing here? Why is it the case that $c=c^\prime$? I assume that, since I'm new in Mathematica, I'm using RegionCentroid
incorrectly, but I can't see how.
RegionCentroid[ConvexHullMesh[points]]
will work when the points form a polyhedron. Your points seem to be coplanar, so they form a polygon. $\endgroup$