Recent Posts

Posted in 3D Chaos Theory Flame Harmonograph Julia Set Mandelbrot Natural

The Very Best Fractal & Mathematical Pictures

This gallery showcases some of our best fractal & mathematical pictures. Start here! We have Mandelbrot & Julia Sets, Lorenz attractors, The Burning Ship, Flame fractals, Harmonographs, Buddhabrots, Menger Sponges, Sierpinskis, 3D Fractals, Fractal Zooms, Lyapunov Fracatals, etc. Oh, and …

harmonograph
Posted in Harmonograph Pyplot

Multi-pendulum Harmonograph simulator using numpy and matplotlib

This is a simple harmonograph simulator to generate random-ish harmonographs. It asks for the number of pendulums, and exits if the number is 0. It also asks for the frequency spread, which means roughly, how far from integer may the …

Posted in Harmonograph Intermediate

Spectral Harmonographs

This Python + Pygame program draws the trace of 4 decaying sine waves, 2 per axis, with rainbow colours. It generates a sequence of random harmonographs.

A harmonograph is a mechanical device typically seen in science museums, that has two …

Harmonograph in Pygame
Posted in Harmonograph

Harmonograph in Pygame

You may have seen those devices at the Science Museum or Exploratorium or Techniquest… There’s a drawing surface and some arrangement of pendula with a pen touching the paper on the drawing surface, set in motion it draws these …

Posted in Basic

Stars and Stripes

A variation on the Stars and Stripes American Flag for Independence Day. It’s an exercise in the use of transparency in Pygame. The stripes are made transparent so the stars image behind shows through.…

Posted in Beginner

Rainbow Flag in Pygame

This little Pygame program paints the Rainbow Flag, as used by the LGBT movement. It illustrates:

Hilbert curve
Posted in Fractals Intermediate Turtle

Drawing Fractals with Lindenmayer Systems

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 …

Posted in Beginner Turtle

A Fake Circle made of Straight Lines

Inspired by this post on Reddit, I wrote this little script to do the same thing. The circle is an illusion created by 100 straight-line tangents to an invisible circle. The tangents are created by drawing a chord in a …

Posted in Beginner Fractals Turtle

Tweetable Python Code Golf

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 …

Posted in Advanced Fractals

Fast Mandelbrot Set by QuadTree

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 …

Harmonograph
Posted in Harmonograph Intermediate

Extensible Harmonograph

Often seen in science museums, the harmonograph is a device that combines wave motions (e.g. from some pendulums) to move a pen resting on a sheet of paper. These movements result in attractive patterns. This device can be simulated easily …

Posted in Basic Pyplot

Easy Graph Plotting with Pyplot

Graphs (also known as charts) are an indispensible visual aid for conveying a lot of data in an easy-to-digest form. Everyone is familiar with graphs in everyday life, such as those showing trends over time, e.g. world population, global …

Posted in Basic Turtle

Random Walk

A colourful random walk. The basic idea is very simple: choose a random heading in the range 0:360 degrees. Step in that direction. Choose another random heading & step again. Do this 2,000 times. As a bonus, we go through …

Posted in Beginner Turtle

Turtle Star

A very simple Turtle program. Turtle can draw intricate shapes using programs that repeat simple moves.

Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig …

Posted in Basic Turtle

Sierpinski Triangle, drawn by a Turtle

This is a classic fractal drawn with a recursion algorithm and Turtle graphics. The Sierpinski Triangle’s sides are bisected and the triangle they form is removed. The procedure is then applied to the 3 remaining triangles, and to them recursively …

Posted in Beginner Turtle

Square Spiral

This is a very simple introduction to Turtle graphics. The turtle starts in the middle of the window, moves forward a small distance, turns right, moves forward a slightly longer distance, right again, even further this time… until the distance …

Posted in Basic Fractals

Naive Mandelbrot Set

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 …

Posted in Fractals Intermediate

Fractal Tree

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

Posted in Harmonograph

Black & White Harmonographs

Black & White Harmonographs. Because colour gets boring after a while…

Harmonographs are those devices often seen in science museums, that consist of a pen connected to a number of pendulums, suspended over a sheet of paper on a board, …

Posted in 3D Chaos Theory

Lorenz Attractor

These 3D pictures (except the last) were generated by a Python + Vpython program, translated from Paul Bourke’s C program (which has a bunch more pretty pictures). See below for code.

The Lorenz system is a system of ordinary differential

Posted in Mandelbrot

Mandelbrot Gallery

Benoit B. Mandelbrot  (20 November 1924 – 14 October 2010) was a Polish-born, French and American mathematician, noted for developing a “theory of roughness” and “self-similarity” in nature and the field of fractal geometry to help prove it, which

Posted in Program

Fractal Python Programs

These fractals were generated by Python programs from the Active State website. They often make use of recursion.

Recursion is the process of repeating items in a self-similar way. For instance, when the surfaces of two mirrors are exactly parallel …

Posted in Mandelbrot

Buddhabrots – Ghosts of the Mandelbrot Set

The Buddhabrot is an interesting variation on the well-known Mandelbrot Set, invented by Melinda Green in 1993. It’s a density plot of the orbits of points outside the Mandelbrot Set. The Mandelbrot Set is defined as the set of …

Posted in Mandelbrot

Orbits of The Starship Mandelbrot, in 3D

Orbits of The Starship Mandelbrot, in 3D.

In fractal mathematics, an orbit is the sequence of points in the complex plane traced out by the iteration of the function that generates the fractal. In the case of the Mandelbrot Set, …