## Wednesday, January 17, 2007

### Ferns on Glass

This is even more off topic than last post. :P

This morning, I noticed that wet windows get a peculiar ice pattern when it's cold enough to freeze them. This pattern looks exactly like fern leaves. The window literally looks like someone painstakingly painted a fern on the glass, vein by vein.

Curious, I melted the ice, re-wet the glass, and watched it freeze.

As far as I can tell, the principle is extremely simple. The reason it looks like ferns is the combination of three factors. First: it's colder at the bottom of the pane than the top, so the water at the bottom freezes first whereas the warm, moist air from the shower keeps the top warm for some minutes, until it cools or radiates away.

Second: small amounts of water freeze faster than large amounts of water (duh).

Third: water trickles down water faster/easier than it trickles down ice.

The combination of these rules means that the points on the glass which are only thinly coated rapidly freeze, but wherever there is a slightly larger amount of water, it takes a bit longer. The water above tries to trickle down, but only really trickles down at the areas where it is still liquid. The more liquid trickling down, the "larger" the "vein" is when it finally freezes.

Water can only travel so far before it freezes, as a function of the size of the vein it is traveling down. This means that everywhere on the window, there are veins. Because of the math behind the forming of veins, this results in main veins which radiate smaller veins, which radiate smaller veins, etc.

The main veins (the "spines" of the "leaves") have graceful curvatures that slowly slope from being within ten degrees of vertical to being around forty-five degrees or sometimes more. I think this is because water flows down the window easier than it flows up. (Although, as far as I can tell, it must either flow up to veins above it or somehow form a vein that looks as though that is what happened...) So, essentially, as the air cools from bottom to top, the freezing process becomes more imminent for water on the same vertical level. Warmer water from above slides down the spine without freezing, but the colder water from a local level freezes, forming a channel for a spine which is more horizontal than it was. I think it's a smooth curve because of the steady flow of water: this isn't a flash freeze, or it would probably be considerably more jagged and straight, like dry window or very low-temperature frost.

This tendency to flow down also means that there is less water at the top of the window when it finally does freeze. This means a more delicate set of veins - the "tip" of the leaf.

It really does look so much like a cluster of leaves.

Anyhow, whatever the full math behind it is, it is an interesting and iterative process. It's not like watching a printer print out leaves: the start is rough and squiggly, it's only as time progresses that it refines. Large patches of what look like empty glass will develop fronds. It's very impressive.

Also, the heat and moisture totally change the type of leaf you get. While the leaf structure was a wide-frond fern when I got there, after my melting and re-icing it was a narrow-frond fern with lots more leaves.

The end result is surprisingly organic and beautiful, something that wouldn't be out of place hung on someone's wall. The rules are fairly simple - I bet they could even be simulated with relative ease.

Now, if three simple rules can create something so complex and beautiful...

Can you make a game that uses three simple rules to make something that complex and beautiful?

Craig Perko said...

I also bet this is roughly the kind of system used to develop veins, nerves, and other widespread systems in infant life forms. Of course, it's not about freezing or whatever: it's some vaguely similar set of rules with vaguely similar results.

Darius Kazemi said...

Can you make a game that uses three simple rules to make something that complex and beautiful?

Well, technically the answer would be Life (Java applet at link), but that's not really a game now, is it?

Craig Perko said...

I'm specifically thinking of a game. Something which can have emotional content somehow. The results of a game of life are often interesting, but they are also often UNinteresting, and they never really leave any lasting sense of beauty or awe.

But that's kind of the same general type of thing. :)

Craig Perko said...

It would be interesting to do a game of life with an EXTREMELY high resolution that has some element of randomness or mutation, though.