Take a polygon with random vertices, find the mid-points of its sides, and use these to create a new polygon, replacing the original. Do this repeatedly and an ellipse will eventually form!

Note that in the above demonstration, the scales are automatically adjusted with each step.

I discovered this while reading *The Mathematical Experience*, shown as an example of "order out of chaos". In fact, Elmachtoub and van Loan show using eigenanalysis that any random polygon will tend towards an ellipse tilted at 45° when undergoing this transformation.

- The Mathematical Experience, Philip J. Davis, Reuben Hersh, pp. 175-177.
- From Random Polygon to Ellipse: An Eigenanalysis, Adam N. Elmachtoub, Charles F. van Loan.
- Thanks to Phil Howard for suggesting the “show alternate frames” option, and to Roy Tu for pointing out a bug in the implementation.