← back to CV $ python isoperimetric.py --interactive

The isoperimetric coin puzzle 🪙

A loop of string with the same perimeter lets a rigid coin slip through when it's a circle, yet jams it when it's a square. Drag the perimeter, the coin and the shape to see why: the circle maximizes the inscribed diameter (P/π). Pure canvas + JavaScript, no libraries.

// classic isoperimetric geometry · my own implementation

— •

setup

geometry

inscribed diameter —
coin diameter —
clearance —
enclosed area —

same P: square vs circle

square —
circle —

—

💡 the isoperimetric principle in 3 lines

  1. Among all closed shapes with a fixed perimeter P, the circle is the one that encloses the largest area.
  2. The circle also maximizes the minimum width of the opening: its inscribed diameter, P / π.
  3. That's why a rigid coin that jams in a square loop slides right through once that same string is opened into a circle.