Fractals are recursion! Ever wondered what do you do when you write a recursion code? Well, I’ve something much physical and much exciting in regards with recursion.

Recursion means to repeat, and what happens when you cut a line in three parts, make the center part shaped like a pyramid and repeat? You get this:

Haha! Wondering what it is, well this is Buddhabrot. (I’ll tell more about it in next article). Anyways, getting back to Fractals, yes this is a Fractal. Literally, Fractals are naturally occurring objects that look recursive, like crystals, DNA, snow flakes and many more. Mathematically, fractals are sets are exhibit a repeating pattern that displays at every scale. The recursion may be little different on different sides – well forget it.

You can read all that history of Fractals on Wikipedia, and I don’t care about it literally. Anyway, here I’m going to describe **Koch Curve**.

So follow this process:

Seems easy? Well, it is. Here we go for another interesting thing. Ever wondered what’s the perimeter of a line which is something like this?

Well, you might thing somewhat equal to the length of the lower line. May be a little more than that. Well, that just twice of the straight line! Shocked? Well be, but it is what it is. So here we go with another puzzle. What is the perimeter of Koch Curve after ‘n’ recursions?

So, that’s `4/3`

of the last iteration. So, after ‘n’ recursions, the perimeter is `(4/3) ^ n`

. So after just 10 iterations, it becomes some 17 times the original, and after 100 times it becomes a freaking ` 3.1179045e+12 `

times!

Soon I’ll come up with a simple program to simulate the perimeter of the Koch Curve, and the design of the Koch curve too, along with many many fractals. Any more information needed? Or anything? Just write a comment and I’d be happy to help