Drawing Fractals with Lindenmayer Systems

17th June 2015

Lindenmayer systems, or L-systems, provide a very powerful way to construct fractals. Lindenmayer used L-systems to describe the behaviour of plant cells and to model the growth processes of plant development. An L-system is a¬†rewriting system and a type of formal grammar. It consists of an alphabet of symbols that can be used to make […]

Tweetable Python Code Golf

9th June 2015

Code Golf is the amusement of writing as short as possible a program to perform a given task. So for example, if the task is to compute the average of a list of numbers (which could be changed at any moment), you might do this: 140 characters (just by coincidence!), or this: 42 characters. In […]

Mandelbrot Set by QuadTree

Fast Mandelbrot Set by QuadTree

27th May 2015

Most Mandelbrot Set programs proceed along the display area, pixel by pixel horizontally, row by row from top to bottom. This one doesn’t. It divides up the screen into 6 horizontal squares in 2 rows, then for each one, checks the value of the escape time¬†for the pixel at each corner. If they’re all the […]

Naive Mandelbrot Set

17th April 2015

This is your basic Mandelbrot Set plotter. Very little effort made to speed it up, except for plotting top & bottom pixels together as they’re mirrored across the x-axis. Later I’ll show you some much faster programs! The heart of this program is the iteration of z2+c where c is a point in the complex […]

Fractal Tree

17th April 2015

This program draws a ‘tree’ by drawing a trunk (initially; later it’s a branch) and appending a tree, recursively. Uses Pillow.