• Welcome to Religious Forums, a friendly forum to discuss all religions in a friendly surrounding.

    Your voice is missing! You will need to register to get access to the following site features:
    • Reply to discussions and create your own threads.
    • Our modern chat room. No add-ons or extensions required, just login and start chatting!
    • Access to private conversations with other members.

    We hope to see you as a part of our community soon!

Current Project: Fractal Generator!

Debater Slayer

Vipassana
Staff member
Premium Member
I'm currently working on a relatively small web-app project. It is a fractal generator using an implementation of the Mandelbrot equation:

5f353c45e68d1a32dd25adc9_1*FE4HFdjJXmdGmNm4LcaVTQ.png


What happens is that the app starts with a canvas on which to draw the fractal and then outputs a shape based on a given number of iterations. Think of a triangle consisting of an infinite number of smaller triangles, or a snowflake consisting of an infinite number of similarly shaped snowflakes; those are fractals.

So, let's say that the app starts with Zo, the initial value of Z, as 2, and c = 1. We get this:

Z = (2)² + 1 = 4 + 1 = 5.

Then the next iteration:

Z = (5)² + 1 = 25 + 1 = 26.

Then the next:

Z = (25)² + 1 = 625 + 1 = 626.

As you can see, this will keep getting bigger ad infinitum—the orbit tends to infinity. On the other hand, let's see what happens if I take Z = i, the imaginary square root of -1, as the starting point, with c = - i:

Z = (i)² - i = -1 - i.

Then we get the next iteration:

Z = (-1 - i)² - i = (1 + 2i - 1) - i = 2i - i = i.

As you can see, this is the same as the initial point I started with, where Z = i. This means that the orbit doesn't tend to infinity. Theoretically, I can use this equation with the values I assigned Z and c above for infinite iterations without the result tending to infinity.

Iterative functions have many real-world applications, like this:

The theory of iterated functions is motivated by questions from real life. Modelling the growth of a population of animals is an example. The size of the population after one breeding cycle depends on how many animals there are at present, so mathematical models of population growth typically consist of a function f in a variable x, where x represents the present population size, and f(x) gives the expected population size after one breeding cycle. To work out the size of the population after any number of breeding cycles you need to iterate the function. Incidentally, the functions used in a standard model of population growth are quadratic polynomials very similar to the ones we will consider here, and this is what first motivated their study.


In this case, I'm just using an iterative function to generate fancy, infinitely complex shapes. Here's a site that does it:


The programming side of this is not terribly complex; it's a straightforward implementation of the equation combined with manipulation of pixel colors to produce the shapes. I mainly chose to start this project on the side because it gives me a way to practice programming while engaging my passion for math. A win-win! :D
 

Heyo

Veteran Member
I'm currently working on a relatively small web-app project. It is a fractal generator using an implementation of the Mandelbrot equation:

5f353c45e68d1a32dd25adc9_1*FE4HFdjJXmdGmNm4LcaVTQ.png


What happens is that the app starts with a canvas on which to draw the fractal and then outputs a shape based on a given number of iterations. Think of a triangle consisting of an infinite number of smaller triangles, or a snowflake consisting of an infinite number of similarly shaped snowflakes; those are fractals.

So, let's say that the app starts with Zo, the initial value of Z, as 2, and c = 1. We get this:

Z = (2)² + 1 = 4 + 1 = 5.

Then the next iteration:

Z = (5)² + 1 = 25 + 1 = 26.

Then the next:

Z = (25)² + 1 = 625 + 1 = 626.

As you can see, this will keep getting bigger ad infinitum—the orbit tends to infinity. On the other hand, let's see what happens if I take Z = i, the imaginary square root of -1, as the starting point, with c = - i:

Z = (i)² - i = -1 - i.

Then we get the next iteration:

Z = (-1 - i)² - i = (1 + 2i - 1) - i = 2i - i = i.

As you can see, this is the same as the initial point I started with, where Z = i. This means that the orbit doesn't tend to infinity. I can use this equation with the values I assigned Z and c above to generate fractals.

Iterative functions have many real-world applications, like this:




In this case, I'm just using an iterative function to generate fancy, infinitely complex shapes. Here's a site that does it:


The programming side of this is not terribly complex; it's a straightforward implementation of the equation combined with manipulation of pixel colors to produce the shapes. I mainly chose to start this project on the side because it gives me a way to practice programming while engaging my passion for math. A win-win! :D
I remember doing that in the late '80s, inspired by my university (Bremen) giving an honourable doctorate to Benoît Mandelbrot in '88. Of course, I didn't get very far with the available equipment. I never managed more than 4000 iterations.
 

Debater Slayer

Vipassana
Staff member
Premium Member
I remember doing that in the late '80s, inspired by my university (Bremen) giving an honourable doctorate to Benoît Mandelbrot in '88. Of course, I didn't get very far with the available equipment. I never managed more than 4000 iterations.

How long did the available equipment take to calculate the iterations?
 

Debater Slayer

Vipassana
Staff member
Premium Member
Update: I got the fractal generator up and running. It produced a fractal identical to this save for the background color, which I can tune in the code:

fractal-431063_960_720.jpg


The more iterations I used, the higher the resolution of the shape was, but I had to make sure I didn't use so many iterations as to overwhelm the device running the code and significantly slow it down during code execution as a result.
 
Top