I'm currently working on a relatively small web-app project. It is a fractal generator using an implementation of the Mandelbrot equation:
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:
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!
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.
What is the Mandelbrot set?
This article gives a short but thorough introduction to that fabled beast of mathematics: the Mandelbrot set.
plus.maths.org
In this case, I'm just using an iterative function to generate fancy, infinitely complex shapes. Here's a site that does it:
Online Fractal Generator
usefuljs.net
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!