Gallery
Strange Attractors
A series of 2D strange attractors I recently created while playing around with some code based on the idea of Paul Bourke's work. The quadratic map used to generate the attractors from random coefficients is defined as: $$ \begin{aligned} x_n &= a_0 + a_1 x_{n-1} + a_2 x_{n-1}^2 + a_3 x_{n-1} y_{n-1} + a_4 y_{n-1} + a_5 y_{n-1}^2\\[6pt] y_n &= b_0 + b_1 x_{n-1} + b_2 x_{n-1}^2 + b_3 x_{n-1} y_{n-1} + b_4 y_{n-1} + b_5 y_{n-1}^2 \end{aligned} $$ I'd like to make a post in the blog explaining the math behind this sometime in the future... I learned about chaos theory while doing it, since the attractors are found by estimating the lyapunov exponent of the system (a measure of how chaotic the system is).
I also came up with a coloring technique based on the density of points per pixel + matplotlib colormaps and procedurally generated colormaps, which I later found out already existed, and learned about optimizing sequential Python code combining Numba and NumPy.
You can find the code in the strange attractors repository.
Strange attractors with absolute valued functions
While doing this, I stumbled upon this book which contains a lot of information about attractor generation + lyapuynov exponents. The book shows how ifyou replace the quadratic functions with the correct absolute valued functions, you get some pretty cool looking attractors like the following ones. The absolute valued ones display sharper edges and interesting, less organic looking structures. This is the formula if you're interested: $$ \begin{aligned} x_n &= a_0 + a_1 x_{n-1} + a_2 y_{n-1} + |a_3 x_{n-1}| + |a_4 y_{n-1}|\\[6pt] y_n &= b_0 + b_1 x_{n-1} + b_2 y_{n-1} + |b_3 x_{n-1}| + |b_4 y_{n-1}| \end{aligned} $$
Glitched Attractors
These ones are generated using the same absolute value function as before, but using Arrupted . With this you can induce real glitches by changing the bytes in the raw data of the image. Different image encodings give different artifacts, for example png give the ones you are seeing below, while others like jpg give patterns related to discrete cosine transform.
A cool Evangelion gif from episode 26