Given a list of coordinates of a coplanar plane $\left(pt_1, pt_2, pt_3, \cdots \right)$, how to compute the centroid of the coplanar plane?

One way to do it is to project the plane onto $XY$ and $YZ$ plane, but I don't really favor this approach as you have to check the orientation of the coplanar plane first before doing the projection and computing the centroid.

More specifically, I'm looking for a natural extension 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 idea?


You can take any two orthogonal vectors $\vec{e_1}$ and $\vec{e_2}$ on the plane and use them as a basis. You also need some point $(x_0, y_0, z_0)$ on the plane as origin.

Given point with coordinates $(x_1, y_1, z_1)$ on your plane you calculate it's coordinates with respect 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 after that you can apply your formulae to get $C_x$ and $C_y$. Those coordinates are easyly transformed back into original 3d coordinates:
$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$

  • 1
    $\begingroup$ So, the final formula is? $\endgroup$ – Graviton Aug 2 '10 at 7:19
  • $\begingroup$ Also, where is Cz? $\endgroup$ – Graviton Aug 2 '10 at 11:53
  • $\begingroup$ There is no $C_z$. You convert original 3d problem into 2d problem, find $C_x$ and $C_y$ and convert back to 3d. $\endgroup$ – falagar Aug 2 '10 at 12:14
  • 1
    $\begingroup$ The answer is $(x, y, z)$ given by the last formulae. $\endgroup$ – falagar Aug 2 '10 at 12:20
  • $\begingroup$ converting this 3d problem into 2d problem is the last thing i want. $\endgroup$ – Graviton Aug 9 '10 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.