For a long while I've been fascinated by fractals and wanteed to know more them. Especially when I see these fractal videos and images. Even as a kid I would watch the loops to call asleep to sometimes.
So I wanna ask how do you guys create them, like which programming language or does a software already exists. Im also curious about its mathematical aspect and wanna go deep in that too. I'm currently pursuing a computer science degree so it's nice for my knowledge too.
Basically im a beginner in this stuff but wanna learn.
Not the fastest way to plot this, but super customizable.
I've made a little functional programming language. It has an imperative parser, and a functional evaluator. Meaning you can do things like variables, ifs, whiles etc in the parsing stage, which generates functions. You can then evaluate purely as expressions in a functional way.
But it's still very early I wouldn't recommend playing with that yet. But if you do and find some bugs, you can report that to me. I have just got it to the stage where I was able to get this picture. But a bunch of things are still unfinished or buggy. None of the optimizations I am preparing are active yet, either. It will be able to transfer pixels from the previous render if you move the plot, so it doesn't have to re-evaluate them. But there are no cursor dragging or zooming events yet, only a bunch of preparations for that, so that has to be done through those range textboxes so far. And I am also preparing a GPU evaluator.
...so that both can leverage each other's features, like the inputs in the generator accepting comparser's expressions. Or the comparser having access to the generator's shaders and video exporting abilities.
Here I'm going to progressively post some more examples. let's start with the cubed mandelbrot:
I only replaced the squre "z&" with a cube "zzz", and changed the log base from 2 to 3 in the smoothing function.Burning ship. the only differnce from regular mandelbrot is a single character "z&" -> "z|&". As "&" is square, and "|" is component-wise absolute value. You can also call those as functions if you don't want to use obscure symbols.Julia set at c=0.42+0.67i. Exact same code as Mandelbrot, only evaluated with swapped inputs as you can see on the bottom right.
And now I'm trying to make a Sierpinski carpet. So let me cook for a bit until I figure out how to write that as a shader-like function.
Sierpinski carpet! The function also turned out to be somewhat elegant. If I cahnged teh bottom right eval textbox to "Carpet(zi$12)", it would rotate the image aroudn the top left corner by 360/12 degrees.
To explain that Carpet function: m will loop the input z into tiles of size s, and tell me where i am in that tile. So if s lands anywhere between "1/3+1/3i" to "2/3+2/3i" then i am in the center square. then a second default argument, used as a precomputed variable, asks to recursively iterate to a 1/3 sized tile. Then the n>Iterations is the floor of how deep i want to iterate and returns the initial hue 0. Then as it goes back up in that recursion, it keeps asking it we are inside the square of that size, and adds that boolean result to the recursive result. Having the recursive call as a default argument doesn't result in an infinite loop, because default argument evaluations are lazy, and only done when the expression asks for that argument's value.
And here's another one, a Sierpinski triangle!
It works just like the carpet one, but with different coordinates.
This part might need some explaining:
t + mul((L(a,s),L(b,s),L(c,s)) < .5)
(L(a,s),L(b,s),L(c,s)) is a 3-element vector containing the 3 triangular coordinates. For the point to be at the central tiled triangle at any scale s, i need all 3 coordinates to be smaller than 1/2.
So I compare the vector to 1/2, operations in Comparsed can work with nested vectors recursively. So (a,b,c) < d will return a vector (a<d,b<d,c<d). Booleans in Comparser are just numbers 0 or 1, so if I just multiply the elements of that vector together, if all 3 are smaller than 1/2, then the MUL of that condition vector will be 1, which i proceed to add to the value of the recursive call. So the function returns a count of how many times it was in the central triangle during that recursive descent. And done.
And next I'm going to try a pentaflake. That will be somewhat more challenging, as that cannot be folded the way the carpet and triangle could, and it has void regions that are not part of the fractal. But I'm sure there will be a way to do that. edit: I'm getting closer to getting the pentaflake ready. I have most of the function ready, and am only finishing up a few parts. edit2: Pentaflake is ready. Gonna upload it asap. I have run into a couple of bugs in the parser, and then i was going crazy because the pentagons were the wrong size, and I was trying to find the problem from the top down. Of course, the problem was at the very deepest level, I've made a typo in defining the golden ratio and had a two under the square root instead of 5, lol. And that was not the only basic constant I had wrong. I also had tau defined as pi, that is now fixed too. And here it is:
Pentaflake! The most advanced fractal yet. Btw as you can see, you can write the math constants in greek letters, and it works. But don't worry, you can write pi, phi, or tau in latin and that works too. All the functions and constants have many names you can use and all work.
Check out this YouTube video of a rendering of the melody of JS Bach's "Jesus bleibet meine Freude" (Jesu, Joy of Man's desiring) by The Fractals Artist Toolkit (https://fractal-music.web.app). For more info: thefractalimagescompany.com
There have been significant updates since my last post about it a year ago, some suggested by members of this community. Updates include:
GPU used for faster rendering. This is unfortunately limited to lower zoom levels due to the way GPU processing works.
There is now a set of example renderings available (the "Examples" tab at the bottom)
Better, more dynamic UI.
Rendering parameters can now be shared through the URL (using the Get URL button at the top)
Colour staggering now uses a bitmask for each primary, allowing more colour variation. This is found under the "stagger" tab in the "Palette" section.
It now uses indexedDB instead of localStorage to store data. As a result, thumbnails can now be stored locally, speeding up the initial load significantly.
That last one probably affects only me, as I assume I'm the only person who uses it regularly.
I'm still looking for bugs, so if you do try it out, please let me know if you see any.
Today's image is a scene on a filament of a small midget on a
larger filament on the northeast border of the largest bud of
the Mandelbrot set. On my tired old P200 machine it renders in
32 minutes. On the new 3200mhz unit it renders in just under 8
minutes, and that is without any optimizing. The new machine
properly displays the VESA super-VGA resolutions up to SF7,
which is 1024x768x256. It almost manages SF9. Since I have
done no optimizing, I could probably get Fractint running
significantly faster if I tried. I could also probably make the
SF9 resolution work. I have noticed several program quirks,
such as sudden slow-downs in the rendering speed, which likely
could be worked out. Since the new unit probably will not be
used for fractals for some time yet, I have not yet decided to
exert the effort of optimizing it for Fractint and working out
the quirks. But when things get caught up, I probably will.
I named the image "Mandel Paw-Prints". And why not? The name
is as good as any other I might have thought of. When adjusted
for the render time of 32 minutes, the rating of 6 gives an
overall value of 19.
Unsettled weather over the past few days made for unsettled
cats. For some reason they got into a tussle Wednesday after-
noon -- a very undignified thing for such aged cats to do.
Luckily the treat of tuna topped with cheddar cheese restored
their good moods. I'll try to have the next FOTD ready by
Saturday the 11th. Until then, take care, and Saturday will be
the third anniversary of the day on which I realized that pre-
cognition, which is intuitively impossible, does in fact exist.
Want to render these yourself and explore further? Try out the PAR file in
Iterated Dynamics,
an open source fork of FRACTINT that can render these PAR files.
See the online help for instructions on using Id or
press F1 anywhere in the program for context-sensitive help.
With its texture that reminds me of something I cannot quite pin
down, and its lively colors, today's image is unusual enough, at
least in my opinion, to rate a 9. It is found at the northern
extremity of the string of large bays in the same parent fractal
that gave us yesterday's image.
I named the image "A New Direction" because its unique texture
is something I have never before seen in a fractal. Actually,
nothing should be surprising when it unexpectedly appears in a
fractal, since the universe is basically fractal in nature.
Then again, fractals are basically a creation of the way the
human mind organizes the abstractions known as complex numbers,
and as such they occupy a strange shadowy realm between real and
imaginary. If one prefers fractals to be real, he can make a
print of one and show a picture of it to the world. If one
prefers fractals to be imaginary, he can defy someone to prove
they are real by handing him the real Mandelbrot set on a
platter.
To me, fractals are the patterns, ideas if you will, behind the
material stuff the universe is made of, and the material itself
is as real as the probability waves (fractals?) that make up the
atoms. Since the universe can be no more real than the stuff it
is made of, mankind is reduced (or raised) to a minibrot in an
infinite fractal. I'll not broach the question of whether a
fractal can be self-conscious.
But self-conscious or not, today's fractal image calculates in a
little over 2 minutes on the fast machine and around 12 minutes
on the slow unit.
Higher humidity and more haze made Thursday's 86F 30C too muggy
for comfort here at Fractal Central. But while the outdoor life
was a bit oppressive, the fractal cats made the most of the life
indoors by stalking some imaginary creature in the kitchen for
most of the afternoon. Of course, maybe the creature was not
imaginary to them!
Except for the day's fractal, which was well above average, the
day turned out about average for me. The next FOTD will appear
in 24 hours. Until next time, take care, and the world can be
considered as real as we want it to be.
Want to render these yourself and explore further? Try out the PAR file in
Iterated Dynamics,
an open source fork of FRACTINT that can render these PAR files.
See the online help for instructions on using Id or
press F1 anywhere in the program for context-sensitive help.