The Shoelace Formula
This post discusses the Shoelace Formula for computing the area of arbitrary simple polygons.
How is the area of an arbitrary simple polygon computed?
If we simply know the lengths of the sides of a simple polygon, we clearly cannot compute its area; just consider the following diagram:

However, if we know the coordinates of each of the vertices of the polygon, we can indeed compute its area. Consider the following polygon:

Suppose that we place it on a coordinate grid (it does not matter how we do this).

We can consider the polygon as a finite sequence of \(n\) points \((P_i)_{i=1}^n\) with coordinates
\[P_i = (x_i, y_i)\]
where \(P_1 = P_n\) (i.e., there are \(n\) elements in the sequence representing the \(n-1\) vertices of the polygon, where the first and final element coincide to "close" the polygon).

We will compute the area of the polygon by covering it with simple polygons whose area we know how to compute. In particular, we will first illustrate this technique using trapezoids. Each consecutive pair of vertices \((P_i, P_{i+1})\) determines a trapezoid whose vertices have coordinates
\[(x_i, y_i), (x_i, 0), (x_{i+1}, 0), (x_{i+1}, y_{i+1}).\]
We choose a "counter-clockwise" orientation for the polygon so that the sign of each edge of the polygon is determined as
\[\mathrm{sign}(x_i - x_{i+1}).\]
Thus, for instance, the edge \((P_1, P_2)\) has negative sign, whereas the edge \((P_3, P_4)\) has positive sign. This enables us to compute signed areas for the covering polygons. For instance, the trapezoid determined by edge \((P_1, P_2)\) has negative area, whereas the trapezoid determined by edge \((P_5, P_1)\) has positive area. The final computed area is precisely the sum of the signed area of all of the covering trapezoids induced by the edges.
However, it is not necessary to use trapezoids. Remarkably, triangles (extending from the origin) also work!

Each consecutive pair of vertices \((P_i, P_{i+1})\) determines a triangle with vertices
\[(x_i, y_i), (0,0), (x_{i+1}, y_{i+1}).\]
The formula for the signed area of the triangle determined by edge \((P_i,P_{i+1})\) in coordinates is given by
\[A_i = \frac{1}{2} \det \begin{bmatrix}x_i & x_{i+1} \\ y_i & y_{i+1} \end{bmatrix} = \frac{1}{2}(x_iy_{i+1} - x_{i+1}y_i).\]
This explains the name shoelace formula: the products in the determinants can be visualized as follows (which resembles the crossing pattern of shoelaces):

Thus, the total area is
\[A = \sum_{i=1}^n A_i.\]
Thus, we have the following theorem.
Theorem (Shoelace). Let \((x_i, y_i)_{i=1}^n\) be a sequence of points in \(\mathbb{R}^2\) representing the vertices of a simple polygon. The area of the polygon is computed as
\[A = \frac{1}{2}\sum_{i=1}^n(x_iy_{i+1} - x_{i+1}y_i).\]
Proof. The polygon can be regarded as a \(2\)-dimensional manifold \(M\) with corners embedded in \(\mathbb{R}^2\). The canonical volume form on \(M\) is given by
\[\alpha = x \wedge y.\]
The volume form is an exact form since \(\alpha = d\omega\) where
\[\omega = \frac{1}{2}(xdy - ydx).\]
Since \(\omega\) is a smooth, compactly-supported \(2\)-form, it follows by Stokes' theorem (for manifolds with corners), that
\[A = \int_M \alpha = \int_M d\omega = \int_{\partial M} \omega.\]
We define an open domain of integration \(D = (0, 1)\) and smooth maps \(F_i : \bar{D} \rightarrow \partial M\) as
\[F_i(t) = (x_i + t \cdot (x_{i+1} - x_i), y_i + t \cdot (y_{i+1} - y_i)).\]
Note that each \(F_i\) restricts to a orientation-preserving map from \(D\) onto an open subset \(W_i \subseteq \partial M\) such that \(W_i \cap W_j = \emptyset\) whenever \(i \ne j\) and \(\mathrm{supp}(\omega) \subseteq \bar{W}_1 \cup \dots \cup \bar{W}_n\). We may thus integrate over these parameterizations as follows:
\[\int_{\partial M}\omega = \sum_{i=1}^n \int_D F_i^*\omega.\]
We thus compute
\begin{align*}\sum_{i=1}^n \int_D F_i^*\omega &= \sum_{i=1}^n \int_D F_i^*\left(\frac{1}{2}(xdy - ydx)\right) \\&= \sum_{i=1}^n \int_D \frac{1}{2}((x_i + t \cdot (x_{i+1}-x_i)) d(y_i + t \cdot (y_{i+1}-y_i)) - (y_i + t \cdot (y_{i+1}-y_i)) d(x_i + t \cdot (x_{i+1}-x_i))) \\&= \sum_{i=1}^n \int_D \frac{1}{2}((x_i + t \cdot (x_{i+1}-x_i)) \cdot (y_{i+1}-y_i)dt - (y_i + t \cdot (y_{i+1}-y_i)) \cdot (x_{i+1}-x_i) dt) \\&= \frac{1}{2}\sum_{i=1}^n \int_0^1 ((x_i + t \cdot (x_{i+1}-x_i)) \cdot (y_{i+1}-y_i) - (y_i + t \cdot (y_{i+1}-y_i)) \cdot (x_{i+1}-x_i))dt \\&= \frac{1}{2}\sum_{i=1}^n \frac{1}{2} ((x_i + x_{i+1})(y_{i+1} - y_i) - (y_i + y_{i+1})(x_{i+1} - x_i)) \\&= \frac{1}{2}\sum_{i=1}^n(x_i y_{i+1} - x_{i+1}y_i).\end{align*}
\(\square\)
The proof suggests that the formula can be generalized to higher dimensions.
Note that we can also express the shoelace formula using exterior algebra. Treating each vertex \(P_i\) as a vector in \(\mathbb{R}^2\), we obtain
\[\lVert P_i \wedge P_{i+1} \rVert = x_i y_{i+1} - x_{i+1}y_i\]
so that
\[A = \frac{1}{2}\sum_{i=1}^n \lVert P_i \wedge P_{i+1} \rVert.\]