# Calculate the Centroid of a $3D$ Planar Polygon Without Projecting It To Specific Planes

Offered a checklist of works with of a coplanar aircraft $\left(pt_1, pt_2, pt_3, \cdots \right)$, just how to calculate the centroid of the coplanar aircraft?

One means to do it is to predict the aircraft onto $XY$ and also $YZ$ aircraft, yet I do not actually prefer this strategy as you need to examine the alignment of the coplanar aircraft first prior to doing the estimate and also calculating the centroid.

Extra especially, I'm seeking an all-natural expansion of the 2D centroid plane algorithm in 3D:

\begin{align} C_x&=\frac1{6A}\sum_{i=0}^{n-1}(x_i+x_{i+1})(x_iy_{i+1}-x_{i+1}y_i)\\ C_y&=\frac1{6A}\sum_{i=0}^{n-1}(y_i+y_{i+1})(x_iy_{i+1}-x_{i+1}y_i)\\ A&=\frac12\sum_{i=0}^{n-1}(x_iy_{i+1}-x_{i+1}y_i) \end{align}

Any kind of suggestion?

You can take any kind of 2 orthogonal vectors $\vec{e_1}$ and also $\vec{e_2}$ on the aircraft and also utilize them as a basis. You additionally require some factor $(x_0, y_0, z_0)$ on the aircraft as beginning.

Offered factor with works with $(x_1, y_1, z_1)$ on your aircraft you compute it's collaborates relative to new basis :

$x = (x_1 - x_0) e_{1x} + (y_1 - y_0) e_{1y} + (z_1 - z_0) e_{1z}$

$y = (x_1 - x_0) e_{2x} + (y_1 - y_0) e_{2y} + (z_1 - z_0) e_{2z}$

And afterwards you can use your solutions to get $C_x$ and also $C_y$. Those works with are easyly changed back right into initial 3d works with :

$x = x_0 + e_{1x} C_x + e_{2x} C_y$

$y = y_0 + e_{1y} C_x + e_{2y} C_y$

$z = z_0 + e_{1z} C_x + e_{2z} C_y$