How to understand a mysterious method to calculate the Centroid of a Quadrilateral?

458 Views Asked by At

We are trying to find the centroid of a quadrilateral by using a method that is different from Wiki: Centroid of a polygon. For a convex (maybe applicable for an arbitrary) 3D quadrilateral has the vertices $V^0_i=[X^0_i,Y^0_i,Z^0_i]$, $i=1\dots4$, in a global frame. In numerical analysis, it is more convenient to work on a local coordinate system for each element and in a simplified 2D region. First we take the averaged point $O^0=[X_o,Y_o,Z_o]$ as the temporary origin of the local frame \begin{align} \begin{bmatrix}X_o\\Y_o\\ Z_o\end{bmatrix}=&\frac{1}{4}\sum_{i=1}^4\begin{bmatrix}X^0_i\\Y^0_i\\Z^0_i\end{bmatrix}. \end{align} The vertices of the quadrilateral relative to point $O^0$ become $V_i=[X^0_i-X_o,Y^0_i-Y_o,Z^0_i-Z_o]$, $i=1\dots4$. Next we can find the local coordinates of the vertices through a standard transformation. Let us build a right-handed set of axes $tsn-$ (local system) as follows: assume a unit vector $\vec t$ is obtained from the bimedian vector of sides $\overrightarrow{V^0_3V^0_4}$ and $\overrightarrow{V^0_1V^0_2}$, the unit normal vector of the quadrilateral plane from $\vec n=\overrightarrow{V^0_2V^0_4}\times\overrightarrow{V^0_1V^0_3}$, and $\vec s=\vec n\times\vec t$. Therefore the local coordinates of the global coordinates $X_i,Y_i$, and $Z_i$, $i=1\dots4$ can be found by the direction cosines. \begin{align} \begin{bmatrix}x_i\\y_i\\ z_i\\\end{bmatrix}=\begin{bmatrix} t_x & s_x & n_x\\ t_y & s_y & n_y\\ t_z & s_z & n_z\\ \end{bmatrix}\begin{bmatrix}X_i\\Y_i\\ Z_i\\\end{bmatrix}\label{eq:G2L_TransForm}, \end{align} where the $t_x,t_y,t_z$ are the direction cosines of the global axes $X,Y,Z$ and the local axis $t$, and the same applies for $\vec s$ and $\vec t$. The next we will assume that the four vertices of the quadrilateral is on the same plane, i.e., the $Z_i=z_i=0,i=1\dots4$. Let introduce two vectors $\vec m$ and $\vec n$ such that \begin{align} \vec m&=\frac{1}{2}\left(x_1+\begin{bmatrix}x_2\\x_4\\ x_3\end{bmatrix}\right)\\ \vec n&=\frac{1}{2}\left(y_1+\begin{bmatrix}y_2\\y_4\\ y_3\end{bmatrix}\right) \end{align} If the cross product of $\vec m$ and $\vec n$ is noted by $\vec l$, then the centroid $[x_c,y_c]$ of the local quadrilateral can be found \begin{align} \begin{bmatrix}x_c\\y_c\\ \end{bmatrix}=-\frac{1}{3l_3}\begin{bmatrix} m_1 & m_2\\ n_1 & n_2 \end{bmatrix}\begin{bmatrix}l_2\\l_1\\\end{bmatrix}\label{eq:Centroid}, \end{align} It is to prove that $l_3$ is a quarter of the quadrilateral area \begin{align}l_3&=\frac{1}{8}\sum_{i=1}^4(x_iy_{i+1}-x_{i+1}y_i), \end{align} where $x_5=x_1$ and $y_5=y_1$.