diff --git a/fractal_project/README.md b/fractal_project/README.md index 149c6c741a1f93c34cee4dc30bb3034183559d2c..49db3e21f6bb3e23bfc0b3bb2b8a745c441289ca 100644 --- a/fractal_project/README.md +++ b/fractal_project/README.md @@ -1,49 +1,6 @@ # Mandelbrot set -## What is the Mandelbrot set? - -## Calculation of the Mandelbrot set - -The **Mandelbrot set** is the set of **complex numbers** $c$ for which the function $f_{c}(z) = z^{2} + c$ does **not** diverge when iterated from $z_{0} = 0$. This means that starting with $z = 0$, if the iterations of the function $f_{c}(z) = z^{2} + c$ do not cause $\left\lvert z \right\rvert$ to grow beyond a certain threshold (usually $2$) after many iterations, then the point $c$ is part of the Mandelbrot set. - -### 1. Choose a complex constant $c$ - -> * Fot the Mandelbrot set, $c$ **is the parameter** that changes with each point we check in the complex plane. The set is defined by **which value of $c$ produce bounded iterates**. - -### 2. Define the complex plane - -> * We need a grid of complex numbers $z$ to iterate over. This grid typically covers a region of the complex plane, like: ->> * Real part $x$ from $-2$ to $2$. ->> * Imaginary part $y$ from $-2$ to $2$. - -### 3. Start with $z_{0} = 0$ - -> * For the Mandelbrot set, **we always start with $z = 0$** for every value of $c$. So, the iteration begins from the point $z_{0} = 0$. - -### 4. Iterate the function $f_{c}(z) = z^{2} + c$ - -> * Apply the function iteratively to the value $z$ starting from $z_{0} = 0$, using the formula: ->> $f_{c}(z) = z^{2} + c$ -> * For each point $c$, we iterate and check whether $\left\lvert z_{n} \right\rvert$ (the magnitude of $z_{n}$) stays bounded (i.e., does not grow beyond a threshold like $2$). -> * If the value of $\left\lvert z_{n} \right\rvert$ grows beyond $2$, then the point $c$ **is not** part of the Mandelbrot set (i.e., it escapes to infinity). - -### 5. Check if $\left\lvert z_{n} \right\rvert$ (the modulus of $z_{n}$) escapes - -> * **Escape condition**: If the magnitude $\left\lvert z_{n} \right\rvert$ of the current value of $z$ becomes greater than $2$, we stop iterating because the value will continue growing towards infinity. This means that the point $c$ is **not part of the Mandelbrot set**. -> * If $\left\lvert z_{n} \right\rvert$ stays below $2$ after a certain number of iterations, then the point $c$ is considered **part of the Mandelbrot set**. - -### 6. Repeat the iteration for a maximum number of iterations - -> * The number of iterations we run is often limited to a maximum (like $100$). If the value of $z$ does not escape within that many iterations, we consider it part of the Mandelbrot set. - -### 7. Color the point - -> * Points that escape quickly (i.e., after just a few iterations) can be colored differently from those that take longer to escape. -> * Points that do **not escape** (after the maximum number of iterations) are part of the Mandelbrot set and are typically colored black. - -### 8. Repeat for all points in the complex plane - -> * After performing these iterations for each point in the grid of complex numbers, you can plot the results. +1. [Mandelbrot set](./mandelbrot.md) # Julia set @@ -57,8 +14,8 @@ The most common function used for Julia sets is the **quadratic** function: Where: -<!-- > * $c$ is a fixed complex number (a constant), chosen by you. --> -<!-- > * $z$ is the point in the complex plane you are testing (a complex number $z=x+y$, where $x$ are real numbers). --> +> * $c$ is a fixed complex number (a constant), chosen by you. +> * $z$ is the point in the complex plane you are testing (a complex number $z=x+y$, where $x$ are real numbers). ## Calculation of the Julia set diff --git a/fractal_project/mandelbrot.md b/fractal_project/mandelbrot.md new file mode 100644 index 0000000000000000000000000000000000000000..c1b66fb69906ebc3a726fefdf5912dd4119245f1 --- /dev/null +++ b/fractal_project/mandelbrot.md @@ -0,0 +1,46 @@ +# Mandelbrot set + +## What is the Mandelbrot set? + +## Calculation of the Mandelbrot set + +The **Mandelbrot set** is the set of **complex numbers** $c$ for which the function $f_{c}(z) = z^{2} + c$ does **not** diverge when iterated from $z_{0} = 0$. This means that starting with $z = 0$, if the iterations of the function $f_{c}(z) = z^{2} + c$ do not cause $\left\lvert z \right\rvert$ to grow beyond a certain threshold (usually $2$) after many iterations, then the point $c$ is part of the Mandelbrot set. + +### 1. Choose a complex constant $c$ + +> * Fot the Mandelbrot set, $c$ **is the parameter** that changes with each point we check in the complex plane. The set is defined by **which value of $c$ produce bounded iterates**. + +### 2. Define the complex plane + +> * We need a grid of complex numbers $z$ to iterate over. This grid typically covers a region of the complex plane, like: +>> * Real part $x$ from $-2$ to $2$. +>> * Imaginary part $y$ from $-2$ to $2$. + +### 3. Start with $z_{0} = 0$ + +> * For the Mandelbrot set, **we always start with $z = 0$** for every value of $c$. So, the iteration begins from the point $z_{0} = 0$. + +### 4. Iterate the function $f_{c}(z) = z^{2} + c$ + +> * Apply the function iteratively to the value $z$ starting from $z_{0} = 0$, using the formula: +>> $f_{c}(z) = z^{2} + c$ +> * For each point $c$, we iterate and check whether $\left\lvert z_{n} \right\rvert$ (the magnitude of $z_{n}$) stays bounded (i.e., does not grow beyond a threshold like $2$). +> * If the value of $\left\lvert z_{n} \right\rvert$ grows beyond $2$, then the point $c$ **is not** part of the Mandelbrot set (i.e., it escapes to infinity). + +### 5. Check if $\left\lvert z_{n} \right\rvert$ (the modulus of $z_{n}$) escapes + +> * **Escape condition**: If the magnitude $\left\lvert z_{n} \right\rvert$ of the current value of $z$ becomes greater than $2$, we stop iterating because the value will continue growing towards infinity. This means that the point $c$ is **not part of the Mandelbrot set**. +> * If $\left\lvert z_{n} \right\rvert$ stays below $2$ after a certain number of iterations, then the point $c$ is considered **part of the Mandelbrot set**. + +### 6. Repeat the iteration for a maximum number of iterations + +> * The number of iterations we run is often limited to a maximum (like $100$). If the value of $z$ does not escape within that many iterations, we consider it part of the Mandelbrot set. + +### 7. Color the point + +> * Points that escape quickly (i.e., after just a few iterations) can be colored differently from those that take longer to escape. +> * Points that do **not escape** (after the maximum number of iterations) are part of the Mandelbrot set and are typically colored black. + +### 8. Repeat for all points in the complex plane + +> * After performing these iterations for each point in the grid of complex numbers, you can plot the results.