homepage
a collection of fractals i made in python
Chaos Game
the chaos game is very simple. you have N vertices, normally arranged in a regular N-gon. each vertex is assigned a probability, lets say 1/N.
now starting at a random point. pick a random vertex based on the probabilities and move to the point halfway between your current position and that vertex.
repeat.
if done with 3 points you get the famous SierpiĆski triangle.
you can do this to create a fractal with any number of points except 4. this happens because the quadrants of a square are identical to the larger square.
so no matter where the point is, it is possible to move to any other quadrant.
as a result of this there is a series of steps which can move between any two points
inside the square, which means eventually every point will be reached. this does not happen with any other shape.
the larger N is the more unclear the fractal pattern is.
next i thought what if i didnt allow it to pick the same point twice in a row.
very cool, 3 points is no longer connected, 4 now has fractal behaviour and 5 just looks awesome.
next at step i didnt let it pick the vertex to its right.
quite nice i especially like the 10 point one in this case. i did some other stuff but nothing i had not seen elsewhere.
last thing on the chaos game, the Barnsley fern.
i cbf explaining it here but check out the wiki, really intuitive explanation.
with just a few tweaks, i modified it to make a tree
i find this super interesting because i think it is somewhat representative of what happens in nature.
its easier to store a couple equations and have the ability to build from scratch, rather then have to copy and store the entire plan every new generation.
Mandelbrot Set + other similar
the most famous fractal, the Mandelbrot Set, i remember watching "10e24 deepest mandelbrot zoom ever" videos on youtube as a kid.
then you learn the process making all that complexity is literally one equation z = z^2 + c.
anyway everyone seen it already so im not gonna show my low res python generated version, but i will show some of its deranged cousins.
perhaps the best known of these is the burning ship fractal. it is generated by squaring the sum of the real and complex components of z. z = (Re(z) + Im(z)j)^2 + c
ok what if i change the exponent of the burning ship?
it looks contnuous i wonder if i can animate it morphing between them? this is z = (Re(z) + Im(z)j)^m + c with m from 1 to 6 and the original z = z^m + c with m = 1 to 5
so then i think why limit myself to only changing the exponent and started putting some really weird equations in the original mandelbrot iteration formula.
Newton fractals
firstly go check out 3blue1brown video on newton fractals, it is what inspired me to make my own.
the premise is based on newtons method for solving the roots of a polynimial but applied to a complex funciton.
so for each point in the complex plane apply newtons method iteratively. this will end up at one the roots of the equation. if we give each root a colour and colour the plance depending on which root each point ended at.
pretty cool.
i tried with lots of other equations, some using complex coefficients, etc. here are some.
but i want to try make an animation like i did for mandelbrot. i think more about how i want to do this.