Julia-Set Code with C++ unclear

511 Views Asked by At

So, I'm working lately on a julia-set code with c++ and there are two formulas in this script. The first one is x = x^2 - y^2 (+ re) and the next one is y = 2*x*y (+ im). I never read this formulas before and i don't know what they are supposed to calculate. Can somebody explain?

1

There are 1 best solutions below

0
On BEST ANSWER

These are the real and imaginary parts of the complex iteration

$$z_{n+1}={z_n}^2 + c$$

Derivation:

Let $z_n = a_n+b_ni$ and $c = x+yi$.

${z_n}^2 + c = (a_n + b_n i)^2+(x+yi) = {a_n}^2 - {b_n}^2+x+(2a_nb_n+y)i$