Here’s a fun project that my friend Upasana and I put together some weekends ago. It’s a visual exploration of fractals through dance, a piece of generative art that’s part performance and part mathematical exploration.

The two ingredients that went into creating this were the Microsoft Kinect sensor, which lets your computer track how your body moves, and Processing, a programming language that lets you create interactive visuals with code. Put the two together, and you can use your body to control virtual shapes and objects.

The idea for this project came about while I was walking home from work late October, idly watching the recently bare tree branches swaying in the wind. And for some reason that made me wonder, what would it be like to be a tree for an evening? Imagine lifting your arms, and a tree waves its branches.

And then I remembered reading about fractals in Daniel Shiffman’s book Nature of Code. Fractals are those wonderfully intricate structures that look the same as you keep zooming in to them. Benoit B. Mandelbrot was one of the earliest explorers of the fractal world. He coined the word fractal to mean a kind of geometric shape whose parts resemble “a reduced-size copy of the whole.” (Some fractal humor: What does the B in Benoit B. Mandelbrot stand for? Benoit B. Mandelbrot.)

At the heart of being a fractal is self-similarity, the idea that each piece appears similar to the whole. Think of how a coastline on a map appears similarly wrinkly across different levels of zoom. The same could be said of the jagged terrain of a mountain.

Or picture the ever branching paths that lightning follows as it travels down to the Earth.

Or the nested arrangement of leaves within a fern.

Or the buds in a head of Romanesco broccoli. Each bud contains smaller buds upon it, arranged in the same spiraling pattern.

From coastlines to broccoli, and lightning to trees, many of nature’s patterns are better described by fractals than by the usual cast of shapes like lines, circles, and triangles. (In the real world, objects can only be roughly fractal, at some level of zoom the repetition will end. But in mathematics, the self-similarity of fractals continues forever.) Continue reading How to Dance with a Tree: Visualizing Fractals With Dance

We’ve all been there. You pick up a slice of pizza and you’re about to take a bite, but it flops over and dangles limply from your fingers instead. The crust isn’t stiff enough to support the weight of the slice. Maybe you should have gone for fewer toppings. But there’s no need to despair, for years of pizza eating experience have taught you how to deal with this situation. Just fold the pizza slice into a U shape (aka the fold hold). This keeps the slice from flopping over, and you can proceed to enjoy your meal. (If you don’t have a slice of pizza handy, you can try this out with a sheet of paper.)

Behind this pizza trick lies a powerful mathematical result about curved surfaces, one that’s so startling that its discoverer, the mathematical genius Carl Friedrich Gauss, named it Theorema Egregium, Latin for excellent or remarkable theorem.

Take a sheet of paper and roll it into a cylinder. It might seem obvious that the paper is flat, while the cylinder is curved. But Gauss thought about this differently. He wanted to define the curvature of a surface in a way that doesn’t change when you bend the surface.

If you zoom in on an ant that lives on the cylinder, there are many possible paths the ant could take. It could decide to walk down the curved path, tracing out a circle, or it could walk along the flat path, tracing out a straight line. Or it might do something in between, tracing out a helix.

Gauss’s brilliant insight was to define the curvature of a surface in a way that takes all these choices into account. Here’s how it works. Starting at any point, find the two most extreme paths that an ant can choose (i.e. the most concave path and the most convex path). Then multiply the curvature of those paths together (curvature is positive for concave paths, zero for flat paths, and negative for convex paths). And, voila, the number you get is Gauss’s definition of the curvature at that point.

Let’s try some examples. For the ant on the cylinder, the two extreme paths available to it are the curved, circle-shaped path, and the flat, straight-line path. But since the flat path has zero curvature, when you multiply the two curvatures together you get zero. As mathematicians would say, a cylinder is flat — it has zero Gaussian curvature. Which reflects the fact that you can roll one out of a sheet of paper.

If, instead, the ant lived on a ball, there would be no flat paths available to it. Now every path curves by the same amount, and so the Gaussian curvature is some positive number. So spheres are curved while cylinders are flat. You can bend a sheet of paper into a tube, but you can never bend it into a ball.

Gauss’s remarkable theorem, the one which I like to imagine made him giggle with joy, is that an ant living on a surface can work out its curvature without ever having to step outside the surface, just by measuring distances and doing some math. This, by the way, is what allows us to determine whether our universe is curved without ever having to step outside of the universe (as far as we can tell, it’s flat).

A surprising consequence of this result is that you can take a surface and bend it any way you like, so long as you don’t stretch, shrink or tear it, and the Gaussian curvature stays the same. That’s because bending doesn’t change any distances on the surface, and so the ant living on the surface would still calculate the same Gaussian curvature as before.

This might sound a little abstract, but it has real-life consequences. Cut an orange in half, eat the insides (yum), then place the dome-shaped peel on the ground and stomp on it. The peel will never flatten out into a circle. Instead, it’ll tear itself apart. That’s because a sphere and a flat surface have different Gaussian curvatures, so there’s no way to flatten a sphere without distorting or tearing it. Ever tried gift wrapping a basketball? Same problem. No matter how you bend a sheet of paper, it’ll always retain a trace of its original flatness, so you end up with a crinkled mess.

Another consequence of Gauss’s theorem is that it’s impossible to accurately depict a map on paper. The map of the world that you’re used to seeing depicts angles correctly, but it grossly distorts areas. The Museum of Math points out that clothing designers have a similar challenge — they design patterns on a flat surface that have to fit our curved bodies.

What does any of this have to do with pizza? Well, the pizza slice was flat before you picked it up (in math speak, it has zero Gaussian curvature). Gauss’s remarkable theorem assures us that one direction of the slice must always remain flat — no matter how you bend it, the pizza must retain a trace of its original flatness. When the slice flops over, the flat direction (shown in red below) is pointed sideways, which isn’t helpful for eating it. But by folding the pizza slice sideways, you’re forcing it to become flat in the other direction – the one that points towards your mouth. Theorema egregium, indeed.