The simplest way to do this: the coordinates of the centroid of a triangle (not, strictly speaking, the "center of mass" because a geometric figure does not have 'mass') is the mean of the coordinates of the three vertices. That is, if the vertices of the triangle are at [itex](x_1, y_1, z_1)[/itex], [itex](x_2, y_2, z_2)[itex], [itex](x_3, y_3, z_3)[/itex], then the centroid is at <br />
[tex]\left(\frac{x_1+ x_2+ x_3}{3}, \frac{y_1+y_2+y_3}{3}, \frac{z_1+z_2+z_3}{3}\right)[/tex]<br />
<br />
If you don't have that theorem, use that as a check.<br />
(The average of the coordinates works for the two dimensional triangle or three dimensional tetrahedron but not for other figures.)[/itex][/itex]