On the shoelace formulas

28 Views Asked by At

I've stumbled on this nice formula to compute the barycenter $\bar{c}$ of an arbitrary (but not self-intersecting) polygon

\begin{equation} \bar{c} \triangleq \sum_{i=1}^n \frac{A_i}{A} \bar{c}_i \qquad A \triangleq \sum_{i=1}^n A_i \qquad \bar{c}_i \triangleq \frac{V_i + V_{i+1}}{3} \qquad A_i \triangleq \frac{\textrm{det}\left(\left[\begin{array}{cc} V_i & V_{i+1} \end{array}\right]\right)}{2} \tag{$\star$} \end{equation} here:

  • $V_i$ is the $i$-th vertex of the polygon. The polygon has $n$ vertices $V_1,\dots,V_n$ and is wrapped, in the sense that $V_{n+1}\triangleq V_1$;
  • $A$ is the area of the polygon;
  • $\bar{c}_i$ is the barycenter of the triangle composed by the three vertex $0_{2\times1},V_i, V_{i+1}$;
  • $A_i$ is the area of the triangle composed by the three vertex $0_{2\times1},V_i, V_{i+1}$;

Now, consider the special case where the polygon is just a triangle $V_1, V_2, V_3$. If I'm not wrong, in this case the previous formulas should give the simple answer \begin{equation} \bar{c}=\frac{V_1+V_2+V_3}{3} \tag{$\star\star$} \end{equation} However, I'm not able to prove this fact. I've tried to compute by "brute force" each single term $A_i, \bar{c}_i$ when the polygon is an arbitrary triangle \begin{equation*} V_1 = \left[\begin{array}{c} a \\ b \end{array}\right] \qquad V_2 = \left[\begin{array}{c} c \\ d \end{array}\right] \qquad V_3 = \left[\begin{array}{c} e \\ f \end{array}\right] \end{equation*} but I failed to get the expected result \begin{equation*} \bar{c}= \frac{1}{3}\left[\begin{array}{c} a+c+e \\ b+d+f \end{array}\right] \end{equation*}

Questions

  1. Is it true that $(\star)$ is equivalent to $(\star\star)$ if the polygon is a triangle $V_1,V_2,V_3$?
  2. Given that the answer of the previous question is positive, is it possible to generalize the equivalence of $(\star)$ to \begin{equation} \bar{c}= \frac{1}{n}\sum_{i=1}^n V_i \tag{$\star\star\star$} \end{equation} when the polygon has an arbitrary number of vertices? For sure, such equivalence is false when there is at least one "fake" vertex $V_k$ with $k\in\{1,...,n\}$ that is aligned to $V_{k-1}, V_{k+1}$ (consider always the wrapping transformation for the special cases $k=1$ or $k=n$). To see why, consider the simple example of a rectangle with an extra vertex that is aligned with two consecutive corners.