Take any bounded 2D region with positive area. Make it ugly. Add dents. Stretch it. Punch holes in it.

Now choose any direction on the compass.

    There is a clean mathematical guarantee: **there is always at least one straight line, oriented in that exact direction, that divides your shape into two pieces of identical area.**

You don't need to guess if a solution exists; the mathematics guarantees it is there. The interesting part is trying to find it anyway.

I recently built a small browser game around this idea called Bisecto, and while implementing the cutting engine, I stumbled into a fascinating gap between mathematical certainty and human perception.

1. The Guarantee: A Smooth Sweep Across Flatland

    Why is a perfect cut guaranteed for any direction? The foundation is a basic consequence of continuity: the **Intermediate Value Theorem (IVT)**.


    *(Here we're talking about a 2D region and a 1D straight line. In 3D, the same argument works with a plane and volume.)*

Consider a bounded 2D region S with finite positive area A > 0. Pick any line orientation θ. Imagine sliding a straight line with that orientation continuously across the shape from one side to the other, parameterized by its position offset t.

Let f(t) be the area of the shape lying on one side of the line:

f(

t) = Area of

Slying on the left side of the line at position

t

Consider what happens as the line sweeps across:

  • When the line is placed entirely to the left of the shape, f(t) = 0.
  • When the line sweeps completely past the shape to the right, f(t) =A.
  • Because area accumulates continuously, f(t) is a continuous, monotonically non-decreasing function.
    Because 0 < *A*/2 < *A*, the Intermediate Value Theorem guarantees that *f*(*t*) must hit exactly *A*/2 at some point:
    

f(

t*) = ½

A

For every orientation, a perfect cut exists. While shapes with internal voids can sometimes allow a small range of offsets that yield a 50/50 split, there is always at least one valid cutting line.

2. The Surprising Part: Existence Does Not Help You Find It

    **The theorem solves the existence problem. It does not solve the search problem.**

And this is where the mathematics stops helping you.

The theorem tells us that a perfect cut exists. It does not tell a human player where to put the knife.

When you give someone an irregular polygon and ask them to cut it in half, they have to rely almost entirely on visual intuition. We naturally use visual shortcuts, but those shortcuts become unreliable for irregular shapes.

3. Why the Obvious Answer Fails: The Center-of-Mass Trap

When people try to divide an unfamiliar shape, a natural instinct is to search for the center of mass (the centroid).

    The assumption feels obvious: *"If my cut line passes through the balance point of the shape, both sides must have equal area."*

The Right Triangle Counterexample

    Consider a simple right-angled triangle with base *b* and height *h*. Its center of mass is located at height *y* = *h*/3.

If you make a horizontal cut straight through that centroid:

  • The top piece is a smaller similar triangle with height â
    h.
  • Because area scales quadratically with linear height:
    Areatop= (â )2Ã Total Area = 4/9 â 44.44%
  • The bottom trapezoid receives the remaining 5/9 â 55.56%.
    Slicing through the centroid produces a **44.44% / 55.56%** split: an **11.11 percentage-point gap** between the two sides.
    
    To get a true 50/50 split, the horizontal cut actually needs to sit at *y* = (1 â 1/â2) *h* â 0.2929 *h*, noticeably lower than the centroid.
    

Why? The centroid is defined by first moments of area: points farther from a reference axis contribute more strongly to the moment. An equal-area cut has a different goal: it simply asks for the same amount of area on each side, regardless of distance.

For a general asymmetric shape, the 50/50 cuts at different angles do not all pass through one common point.

4. It Gets Stranger: The Ham Sandwich Theorem

    What happens if you have **two** independent shapes on the plane, like a pool of ink and a slice of bread? Can a single straight line bisect both of them simultaneously?


    **Yes.** The two-dimensional case is sometimes called the pancake theorem, a special case of the **Ham Sandwich Theorem**.


    The geometric intuition behind the 2D case is elegant: for well-behaved shapes where the bisecting line moves continuously with the angle *θ*, we can track how that line interacts with the second shape:
  • For each angle θ, consider a lineL1(θ) that bisects Shape 1.
  • Now measure how that line splits Shape 2. Define the difference:
    g(θ) = Area2(left side) â Area2(right side)
  • Rotate your angle by 180 degrees (Ï radians). The left and right sides of the line trade places, which means:
    g(θ+ Ï) = âg(θ)
  • Because g(θ) varies continuously and flips signs over a half-rotation, the Intermediate Value Theorem ensures there is an angleθ whereg(θ**) = 0.

At that angle, one straight cut divides both shapes in half at the same time. In 3D space, this generalizes to bisecting three volumes (bread, ham, and cheese) with a single 2D planar slice. The general proof for arbitrary measurable sets uses the Borsuk-Ulam theorem on spheres.

5. How I Turned the Math into a Game

Turning continuous theorems into a responsive browser game required solving a few computational geometry challenges in TypeScript.

The interesting part was that I could not simply "check" whether the player's line was correct. I had to actually construct the two resulting regions and measure them in real time. Because the game generates shapes with holes, clipping the outer boundary was not enough; I also had to preserve the topology and winding of the interior rings:

1. Exact Area with the Shoelace Formula

To measure polygon area in O(N) time, we use the Shoelace Formula:

i=0(

nâ1x

iy

â

i+1x

i+1y

) |

iOuter boundaries are wound counter-clockwise (positive signed area), while hole boundaries are wound clockwise (negative signed area). The formula naturally subtracts the empty space without needing extra triangulation.

2. Polygon Ring Clipping

When the player commits a cut line:

  • We use Sutherland-Hodgman-style clipping to split each polygon ring against the cutting line.
  • We reconstruct the resulting child polygons and preserve their boundary winding so internal holes continue to subtract negative area correctly on each side.
  • The resulting piece geometries are passed back to the renderer and area calculator.

3. The Scoring Formula

Once both pieces are measured, the accuracy score is computed as:

A, Area

B) / (½ Total Area) ] à 100%

This formula has a clean property: it is completely symmetric. It does not matter which side of the line is labeled A or B:

  • A 50.0% / 50.0%split scores100.0%.
  • A 49.5% / 50.5%split scores99.0%.
  • A 48.0% / 52.0%split scores96.0%.

6. Why This Is Harder Than It Looks

Humans are remarkably good at recognizing visual symmetry, but estimating area becomes surprisingly tricky when a shape becomes asymmetric, concave, or contains holes:

  • Narrow Bridges:A thin neck connecting two large lobes contains very little area, but it can make the shape look as though the natural dividing point should pass through the neck.
  • Negative Space:Holes make visual area estimation much harder, particularly when they are off-center.
  • Pointy Lobes:Long acute corners visually draw attention and can make one side appear heavier than its actual surface area.

Try It Yourself

      I turned these algorithms into a small browser game called **Bisecto**. Every round generates an irregular shape and asks you to find the 50/50 cut.

I would be particularly interested in hearing whether the shapes that are mathematically difficult actually feel difficult to humans.