DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Mandelbrot Set With Pgm Output

02.09.2006
| 203 views |
  • submit to reddit
        
float x,y=1,s=1./128,X,Y,V;main(i){for(puts("P5\n257 127\n63");X=Y=0,x?
x+=s,1:(x=-2,y-=s);putchar(i))for(i=64;--i&&X*X+(V=Y*Y)<4;X=X*X-V+x)Y=2*X*Y+y;}
    
    Tags:
  • C