Mandelbrot Set
Fractal pattern
Math
from CodingTrain Coding Challenge:
https://www.youtube.com/watch?v=6z7GQewK-Ks
- Sqrt(-1) is an imaginary number i
- Complex number has a real component (a) and an imaginary
component (b): a+bi
- Set of complex mapped on canvas with x axis mapping a and
the y axis mapping b
- Function f(z) = z^2 + c = z^2 + (a + bi)
- f(z_0) = 0
- f(z_1) = 0^2 + (a + bi) = a + bi = c
- f(z_2) = c^2 + c --> need to find out c^2
- c^2 = (a + bi) * (a + bi) = a^2 + 2abi + b^2*i^2 = a^2 +
2abi - b^2 = (a^2-b^2) + 2ab * i
- --> meaning c^2 is a complex number with a real component
a^2-b^2 and and imaginary component 2ab
- when calculation iteration over many iterations does
result of function stay bounded or goes to infinity
Code Setup
From D3-Svelte Starter:
https://vizhub.com/higsch/8599a94f8de14a858c04f8064ce368d7