The Mandelbrot Set $M$ is the [[Set]] of all [[Point|Points]] within the [[Complex Plane]] $\C$, where the point $c \in \C$ remains [[Finite]] when recursively applying this [[Function]]:
$\huge \begin{align}
z_{0}(c) &= 0 \\\
z_{n+1}(c) &= z_{n}^2 + c \\
\\
\end{align}$
$ \huge c \in M \iff \lim_{n\to\infty} z_{n} \text{ remains finite} $
![[../../00 Asset Bank/Pasted image 20241120142459.png|sepia]]
>[!note]
>In these images, only the points colored black are part of the set, all other points are mapped to some color dependent on how quickly they blow up to [[Infinity]].
```rust
const ITERATIONS: usize = 100;
fn inside_set(c: Complex) -> bool {
let mut z = Complex::new(0., 0.);
for i in 0..ITERATIONS {
z = z * z + c;
}
return z.abs() < 2.;
}
```