# What does the shoelace formula mean for polygons with crossings?

Given a simple polygon with vertices (in order) $$v_1,v_2,\ldots,v_n$$, the area of this polygon can be computed based on only the coordinates of these vertices via the shoelace formula:

$$A=\frac{1}{2}\left|\ \sum_{i=1}^{n-1} (x_iy_{i+1}-y_ix_{i+1}) + (x_{n}y_{1} - y_{n}x_{1})\ \right|,$$ where $$v_i=(x_i,y_i)$$.

We can still compute this value if we have a polygon that is formed by a single boundary (so no holes), but has multiple crossings. Does the value $$A$$ have a geometric meaning in this case?

To motivate the problem, let me give an example. Take the following polygonal chain with vertices A-F:

In this case, $$A=15$$. If we sum up the areas of ABH, EFHG, and GCD, we get the same value. So, in this case the area in GHI is counted two times, and in the other parts of the polygon the area is counted once.

So, it seems that $$A$$ is equal to the total area in the polygon, but certain regions are counted more than once, depending on the specific order of crossing. This leads to the following questions:

• Is it indeed true that $$A$$ is a weighted sum of the 'subareas' of the polygon, and how can we prove this?
• How can we determine the weights for each area?
• May I suggest doing an experiment? Try the shoelace formula on something like a bowtie (two triangles meeting at a corner), and see if you get a result consistent with computing the area of the two triangles separately. – J. M. is a poor mathematician Mar 28 at 13:49
• @J.M.isnotamathematician Good idea! I've made a slightly more interesting example, because the area of the bowtie is relatively well-defined, but for the objects in my example it is not clear to me what the actual area of the polygon defined by the crossing chain even should be. – Discrete lizard Mar 28 at 14:16

Given a cyclic polygon $$\gamma: (x_i,y_i)_{1\leq i\leq n}$$ in the $$(x,y)$$-plane the expression $$A:={1\over2}\sum_{cyc} (x_iy_{i+1}-x_{i+1}y_i)$$ represents the following quantity: The curve $$\gamma$$ has for each point $${\bf z}\notin\gamma$$ a certain winding number $$n_\gamma({\bf z})\in{\mathbb Z}$$. Geometrically you can determine this number by drawing a ray starting at $${\bf z}$$ and going out to infinity in an arbitrary direction. Then count all intersections of $$\gamma$$ with this ray according to sign: crossings from right to left count as $$+1$$, and crossings from left to right count as $$-1$$. The total is $$n_\gamma({\bf z})$$.
The answer to your question then is: An "area element" centered at $${\bf z}$$ is counted $$n_\gamma({\bf z})$$ times in the expression $$A$$.