From the blue-and-black symmetries of a butterfly TO the mazelike grooves of a brain coral, nature reveals itself as a great artist, switching off between painting and sculpture. Nature should also get credit, though, for being a first-class mathematician. The patterns and shapes of living things correspond to some of the most abstract ideas in math.

The humble mollusk, for example, without a single course in algebra, can draw the equation r = ae . The philosopher and mathematician René Descartes discovered this formula for the curve of shells 354 years ago. To create the curve, technically known as a logarithmic spiral, Descartes’s equation guides your pen around a central point, degree by degree, and pushes it farther away from the center by a factor related to the angle it has reached.

With graphics computers at their disposal, researchers can now flesh out Descartes’s inspiration. The bestiary of three-dimensional shells on these pages was generated by simple equations. Depending on its complexity, one shell can take an hour or two, says Przemyslaw Prusinkiewicz, a computer scientist at the University of Calgary, in Alberta.

Prusinkiewicz’s team started with Descartes’s formula but added a third dimension to it. As a spiral grows out radially, it also descends an axis at the same rate. This creates a helix that the shell is then built around.

If you follow the surface of a real shell around its gyres, you’ll notice that the curve never changes--it just expands in size. To simulate this, the researchers tried to draw by hand on the computer the curve they saw in the profile of real shells. We used the same kind of drawing tools used in computer car design, says Prusinkiewicz. The computer placed a very small version of the curve at the top of its helix and moved it down. At each step it magnified the curve, and when it was done, it smoothed the thousands of curves into a surface that looks unquestionably like a shell.

To reproduce a particular species, the researchers had only to choose the correct curve and expansion rate. At the same time, they added realistic details like ridges by fiddling with the curve or cyclically changing the radius of the shell.

As they sculpted the shell, they also painted it. The equations they used are based on a model of pigment distribution worked out by Hans Meinhardt of the Max Planck Institute for Developmental Biology, in Tübingen, Germany. It has always puzzled researchers how the cells in an animal, whether a mollusk or a leopard, can create patterns that are millions of times bigger than those cells. In Meinhardt’s scenario, cells produce a precursor chemical that diffuses slowly. The cells can also convert the precursor into a second chemical, called an activator, which actually guides pigmentation. If there’s enough activator in one spot of the shell, that spot becomes colored. The activator also has the ability to stimulate neighboring cells to convert precursor into activator. If left unchecked, one molecule of the activator would start a runaway growth, leaving the shell totally colored. But because the production of the activator depletes the precursor, the production of the activator will eventually be limited. By changing the numbers in his equations governing the production and diffusion rates of the chemicals, Meinhardt is able to mimic real mollusk patterns.

All of this happens only along the thin strip at the growing edge of the shell. In order to work out the equations, the computer divides the edge into thousands of segments. It measures how much activator and precursor exist in each segment and decides how they affect the levels in neighboring ones. If the computer then sees that the activator has reached a threshold in a certain segment, it colors that segment. Then the computer extends the shell another increment and starts again. It’s the patterns that take up so much of the computer’s time, says Prusinkiewicz, who is hammering out some flaws he sees in the equations--their inability, for instance, to reproduce the flare at the mouth of a shell or the spikes on a conch.

Prusinkiewicz’s ultimate dream is to find a way to mathematically create any organism. I’m working on a general theory of how patterns form in nature, he says. Perhaps in a few decades we’ll be able to watch a mathematical human grow to adulthood on a computer screen.