Calculate geometry properties using boundary coordinates

analysisanalytic geometrycomputational geometrygeometry

Calculation of geometry properties of various shapes are useful specifically in engineering purposes. This is very easily formulated when the shapes of the geometry are rectangular, circle, etc. However, when the shape of becomes a combination of these and becomes more complicated, such calculations become too tough. In some engineering cases these shapes are simplified, in some scientific cases users take advantage of numerical packages coded in Python or similar scientific applications.

Are there any way to calculate geometry properties (like perimeter, area, first and second moment of inertia, etc) of sections with arbitrary shapes, using coordinates of some points on their boundaries?

My question focuses on two-dimensional shapes, however when shapes are in three-dimensional form, it may be interesting to know that how point coordinates on the boundary may be used to calculate properties like volume, center of gravity, surface area, etc.

Best Answer

Let $v : [n] \rightarrow \mathbb{R}^2$ be the consecutive vertices of your $n$-vertex simple polygon. The perimeter is simply the sum of the lengths of the edges between vertices: \begin{align*} P &= \sum_{i \in [n]} |v_i-v_{i+1}| \end{align*}

where $v_{n+1} \stackrel{\text{def}}{=} v_1$. The signed area is given by the shoelace formula: \begin{align*} A &= \frac{1}{2} \sum_{i \in [d]} \star(v_i \wedge v_{i+1}) \end{align*}

where $\star$ is the Hodge dual and $\wedge$ is the wedge product: \begin{align*} \star (v_i \wedge v_{i+1}) &= \det \begin{bmatrix} x_i & x_{i+1} \\ y_i & y_{i+1} \end{bmatrix} \\ &= x_i y_{i+1} - x_{i+1} y_i \end{align*}

The area is $|A|$. The centroid (center of mass) is \begin{align*} C &= \frac{1}{6 A} \sum_{i \in [d]} \star(v_i \wedge v_{i+1}) (v_i + v_{i+1}) \end{align*}

The moments of inertia are given here. In general, you can decompose an arbitrary polygon into a set of triangles and compute properties based on known formulas for those triangles.

Related Question