Fractals: It goes on and on and on and on (and on and on forever)

Avi Gupta
hackerLog
Published in
4 min readDec 8, 2018

What is a fractal?
A fractal is basically a shape that repeats the same form infinitely in math. Let’s say we have a rectangle:

The rectangle.

What if we kept making smaller rectangles at 1/4 the size of the previous one?

Let’s try it:

The fractal described.

Okay.

So maybe it isn’t infinite, but it repeats on some sort of scale. Like any fractal does. This is called recursion, where you take the output of each iteration, or repetition that runs a certain process, and put it as the input of the next iteration.

Fractals aren’t just on your computer. There are a lot of fractals in nature. Take a look at this fern leaf:

A fern leaf. Picture of fern courtesy of VideoBlocks.

If you look at line 1, you will se that along it, there are multiple smaller leaves. But among line 2 is the same thing: multiple smaller leaves. Cool, right? Even though it is not infinite, it repeats among some scale.

There are many simple fractals, like the Sierpinski Carpet.

The Sierpinski carpet showed at its first 6 iterations. Courtesy of Wikipedia.

Or the more complex ones, like the Mandelbrot set. It looks like this at first :

The Mandelbrot set created by the code

My code variations on GitHub here.

But as you zoom into the Mandelbrot set (which can be done), you get this:

Mandelbrot set zoom. Courtesy of Wikipedia.

No matter where you zoom into on the Mandelbrot set, at some point, you will get a smaller version of the Mandelbrot set.

Think about the rectangle fractal that I just showed you earlier. If there were an infinite amount of rectangles, and you were to zoom into the bottom left corner of the rectangle, you would keep getting the same rectangle. Over and over and over again.

Here’s another zoom:

Another Mandelbrot set zoom. courtesy of MakeAGif.com.

So, what are some interesting patterns in each fractal?
The Sierpinski carpet is an interesting fractal. If you count the number of white squares that are in each iteration, they equal to:
9^# of iterations.
The Mandelbrot set is something different. It has to do with a complex plane, which has both real ( “the number 2 “ real) and imaginary (“√-1”) axises.

A Mandelbrot set on the complex plane.
Courtesy of Wikipedia.

This means that the Mandelbrot set follows the equation:

Courtesy of Wikipedia

In which all of the real points on the complex plane are between -2 and 2 and all of the imaginary points on the complex plane are between -2i and 2i.
That’s just the points that are used to make the fractal. The colored version has a meaning to its colors. The colors represent how many iterations it took to prove that

Courtesy of Wikipedia.

was greater than 2, greater than 2i, less than -2, and less than -2i.

Many fractals use equations and interesting math patters in them. For example, look at Pascal’s triangle (below). It takes the top 2 numbers and adds them to make a number at the bottom. If you shade in all of the odd numbers…

Pascal’s triangle with all of the odd numbers shaded in. Courtesy of Wikipedia.

… you get a fractal called Sierpinski’s triangle. Fractals can be found all over the place, in nature or in math.

Fractals are interesting, and if you want to see more fractals or learn about more fractals, check out the links below:

https://www.marksmath.org/visualization/julia_sets/
http://tilde.club/~david/m/#zoom=5.970731707317073,3.4&lookAt=-0.6,0&iterations=100&superSamples=1&escapeRadius=10.0&colorScheme=pickColorHSV1
http://hirnsohle.de/test/fractalLab/ (3D fractals!)
http://codinglab.huostravelblog.com/math/fractal-generator/index.php?fractal=DRAG&step=14&size=600&color=000000 (more fractals to choose!)

It does go on and on and on and on forever because there is no true limit to the iterations that can go into a fractal. We make them up until a certain iteration, because if it went on forever, we would never able to compile to them.
But in their true form, it is an infinity of the same thing forever, over again and over again.

signing out for the next time,

Avi

--

--

Avi Gupta
hackerLog

Named after the first 2 games I got on my xBox, Forza and Minecraft. Also, i have a blog. Real name is Avi.