All I can give you is the usual formulas:
In two dimensions, the centroid is given by
\overline{x}= \frac{\int\int x dydx}{\int \int dydx}
\overline{y}= \frac{\int\int y dydx}{\int \int dydx}[/itex]<br />
where the integrals are taken over the two dimensional figure.<br />
<br />
In three dimensions, just exend those formulas:<br />
\overline{x}= \frac{\int\int\int x dzdydx}{\int\int \int dzdydx}<br />
\overline{y}= \frac{\int\int\int y dzdydx}{\int \int\int dzdydx}<br />
\overline{z}= \frac{\int\int\int z dzdydx}{\int\int\int dzdydx}<br />
<br />
where the integrations are not over the three dimensional body. The denominators of those fractions are the area of the two dimensional figure and volume of the three dimensional figure. If they have a reasonable geometry, you might be able to find it without integrating.<br />
<br />
For example, to find the centroid of the triangle with vertices at (0, 0), (a, h), and (b, 0) we take the area to be "one half height times base" or (1/2)bh. <br />
<br />
But we still have to integrate to find the centroid:<br />
\overline{x}= \frac{\int_{y= 0}^h\int_{x= ay/h}^{b-\frac{b-a}{b}y} x dxdy}{bh/2}<br />
\overline{y}= \frac{\int_{y=0}^h\int_{x= ay/h}^{b- \frac{b-a}{b}y} y dx dy}{by/2}<br />
Where the limits on the inner integral are the equations of the lines from (0, 0) to (a, h) and from (a, h) to (b, 0).<br />
<br />
After some tedious computation one can show that centroid is at<br />
\left(\frac{a+ b}{3}, \frac{h}{3}\right)<br />
That is, the coordinates of the centoid are the arthmetic averages of the x and y coordinates of the vertices. That is NOT in general true of figures with more than three sides. You could divide a polygon into triangles but then the centroid of the polygon would be a <b>weighted</b> average of the centroids of the triangles, weighted by their area.