5
$\begingroup$

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?

1 Answers 1

4

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
    So, the final formula is?2010-08-02
  • 0
    Also, where is `Cz`?2010-08-02
  • 0
    There is no $C_z$. You convert original 3d problem into 2d problem, find $C_x$ and $C_y$ and convert back to 3d.2010-08-02
  • 1
    The answer is $(x, y, z)$ given by the last formulae.2010-08-02
  • 0
    converting this 3d problem into 2d problem is the last thing i want.2010-08-09
  • 0
    I suspect this formulation has the potential to be singular, when we expect it not to.2014-01-12
  • 0
    Do the two vectors on the plane have to be at right angles? What if we take any two non-collinear vectors (by taking vectors from the vertices of the polygon plane)?2015-05-03
  • 0
    @Mikhail Do you have any idea in what circumstances it could be singular?2018-05-29
  • 0
    "Given point with coordinates (x1,y1,z1) on your plane you calculate it's coordinates with respect to new basis..." So you're supposed to do this with each of the polygon's vertices, basically putting them into the coordinate system of the polygon's plane?2018-05-30