Compute the Centroid of a 3D Planar Polygon Given a list of 3D coordinates that define the surface( Point3D1, Point3D2, Point3D3, and so on), how to calculate the centroid of the surface?
More specifically, I am looking for a natural extension of the following 2D centroid algorithm  in 3 or more dimension:



Any idea?
P/S: All the points are coplanar, this is the assumption. 
 A: In response to JBL's comment, I offer this answer merely to close out this topic.  It has been effectively answered in the comments:
Simply project to xy and to xz and compute the centroid there.  (One tiny wrinkle not addressed is if the polygon lies in a plane perpendicular to xy or to xz.  But then simply chose the coordinate planes in which it does not lie.) 
On the advice of Andrew Stacey, I am designating this answer "community wiki," and hope that someone will vote it up so it will no longer be bumped to the top of the active list by the MO background process.
A: These formulas could be deduced using  Green's theorem . For example the formula used to compute the polygon's area is proved using the vector field F=(-y/2,x/2).
Maybe you can do the same in the space using analogous vector fields and  Stokes' theorem .
A: I'm not sure about the centroid of the surface area, but I might be able to help with the centroid of it's enclosed volume under some specific circumstances.
If each surface formed by the points creates a triangle (as is the case with the vast majority of computer related applications) then you can use this method that i outlined in StackOverflow (i understand its not in the from a mathematician would like it in, but if you read the explanation the answer is fairly simple).
https://stackoverflow.com/questions/2083771/a-method-to-calculate-the-centre-of-mass-from-a-stl-stereo-lithography-file
Hopefully that helps
A: It seems easiest to give up on the centroid and simply find the average of the vertices of the planar figure you want to find the "center" of.  I have a demo program: http://www.mjmtools.com/webgl/tutorial/rhombicTriacontahedron/index.html
With it you can load 3D shapes, and then display new shapes based on the centroid of the each face (using the projection method outlined in the other answers) and you can also display new shapes using the simple vertex average of each face.  You can see by visual inspection they are the same, even for shapes with irregular faces (e.g. the Tetartoid.)
Interested to dig deeper and see why these produce the same results.
