I’ve always been fascinated by fractals and strange attractors. One of the most famous strange attractor system is the Lorenz system. But with some trial and error, you can find some formulas that create “chaos”. In this post, I used a system of equations, described in the book “Chaos In Wondeland” by Cliff Pickover.

The 2D system of equations is written as:

$\begin{eqnarray} x_{t+1} &=& \sin(y_t b)+c \sin(x_t b),\\ y_{t+1} &=& \sin(x_t a)+d \sin(y_t a) \end{eqnarray}$

where
$-\pi \le a,b \le \pi$
and
$-\frac{1}{2} \le c,d \le \frac{3}{2}$

Choosing the right parameters is the true art. By picking them carefully, you can get very beautiful drawings. In my implementation, I chose to render the output as if an artist draws them by hand with a HB pencil. Per frame update, 1 million points are drawn. The soft and curly drawings somehow remind me of the drawings of Leonardo DaVinci.

You can run the application yourself by clicking on one of the images. In the application, you can use the following keys:

• 0-9: Some nice pre-set drawings
• s: Save your current drawing as png
• [mouse click]: Create a new drawing

If nothing seem to happen after 30 seconds, it usually means that the drawing stays in a few (almost invisible) pixels. Just mouse-click again for a new set of parameters. Below I’ve included some of my favourite outputs.