Tuesday, May 23, 2017

Chaotic fractals of mandelbrot

f(z) = z^2 + C
where z is a complex number (vector)
and C is a complex constant (vector of a constant norm)

output from my Xcode project:


for(i=0; i <iter;i++){
        float x = (z.x * z.x - z.y * z.y) + c.x;
        float y = 2.0 * (z.x * z.y) + c.y;

if((x * x + y * y) > 40.0break//distance from the origin>2 ==> done!!
        z.x = x;
        z.y = y;

}
After 355 iterations:




0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home