The Math of Tie-dye

Occupy Math has done several articles on fractals, but most of these were highly structured. Today we look at a fractal built with random numbers that simulate tie-dye patterns. Let’s start with our goal – a really lurid picture!

td01

This is a type of fractal called a random midpoint fractal. The basic structure of this type of fractal is to (repeatedly) divide a line in half and displace the midpoint, where the line is split, by a random amount. The following animation shows five steps of this process.

midpoint

 

This type of fractal is used to build virtual landscapes.

The roughness of the resulting fractal is controlled by selecting the variability of the random midpoint displacements. The next natural question is “what is the two dimensional version of splitting a line and moving the midpoint?” You move the point in the center of a rectangle up or down in a way that splits it into four (tilted) rectangles – and then displace the midpoints of those rectangles.

displace

Okay, but where does the tie-dye come from already?

To get tie-dye you map the heights of the landscape onto colors. Here are a few examples with the height component left in.

lsc01

lsc02

lsc03

Stop displaying the height and the tie-dye appears.

plasmaa

plasmab

plasmac

It is, of course, possible to select the colors of the tie-dye pretty whimsically, permitting all sorts of different types of virtual “fabric”.

You can shape these fractals to your needs.

One of Occupy Math’s recent articles is titled Evolution Can Do Math That People Can’t. Evolution can also be used to shape random midpoint fractals in a number of ways. Here is an example from one of Occupy Math’s papers that uses evolution to generate a palette of possible landscape features. The following image comes from asking evolution to match an idealized crater – which it can’t do with a midpoint fractal – generating a whole lot of useful near misses.

lscrater1

A big part of mathematics is learning to approximate things. Normally the goal is to get a really good approximation – but Occupy Math’s project for evolving libraries of landscape features does something else with approximation. Since a midpoint fractal cannot exactly match a smooth crater, asking it to do so creates a space with billions of near misses. These, in turn, provide a large collection of different craters. The next crater, for example, isn’t a bad approximation, but it has a blown-out side with “daughter” craters.

lscrater2

There is a gallery of these fractals (some of which appear in today’s post) as part of the fractal taxonomy web site.

This blog has been about pretty pictures, but it raises a couple of important points. Once we have a nice class of fractals — like random midpoint fractals — it is possible to take them to new places with both mathematical analysis and tools like digital evolution. Knowing math permits you to do more with the interesting things you encounter. The second point is that failure is a useful tool. The craters in this post are all failures, the result of asking an algorithm to do something impossible. Looking at what happens when you try to do something impossible is a useful research tool.

Occupy Math hopes that you have enjoyed this tour through yet another type of fractal. Suggestions and pointers to types of fractals Occupy Math is not yet aware of are quite welcome. For one thing, once he gets it in his clutches, Occupy Math can come up with new versions of new fractals. Do not be shy about commenting or tweeting topics you want to see more of, be they fractals, weird math, or great math people.

I hope to see you here again,
Daniel Ashlock,
University of Guelph,
Department of Mathematics and Statistics

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s