7 const int MAXX = 1000, MAXY = 1000;
9 void draw(double re, double im, int its, int mits) {
10 //putchar(33 + its % 128);
14 p.a = 255 * (1.0 - powf((float)its/(float)mits,1/3.0));
15 p.b = 255 * (1.0 - powf((float)((2*its)%(mits/5))/(float)(mits/5),1/3.0));
16 p.c = 255 * (1.0 - powf((float)((3*its)%(mits/3))/(float)(mits/3),1/3.0));
17 //write(stdout, &p, sizeof(p));
23 void mandel(double complex Zin, double complex C, int mits) {
27 // const int MAXX = 80, MAXY = 40;
29 double complex Z = 0 + 0;
31 for (py = 0; py != MAXY; py++) {
32 for (px = 0; px != MAXX; px++) {
34 C = 4.0 * ((double)px / (double)MAXX) - 2.0 + \
35 I * (4.0 * ((double)py / (double)MAXY) - 2.0);
36 // printf("re = %g im = %g\n",(float)(creal(Z)), (float)(cimag(Z)));
42 // printf("re = %g im = %g\n",(float)(creal(Z)), (float)(cimag(Z)));
44 draw(px, py, its, mits);
51 char p[]={0,0,0}; /*write(stdout,p,sizeof(p));*/
61 printf("P6\n%i %i\n255\n",MAXX, MAXY);