#include #include #include #include "complex.h" #include "fractal.h" static complex the_fun(complex c,complex z) { complex tmp = cmul(z,z); complex tmp2 = cadd(tmp,c); cdelete (tmp); return tmp2; } static char star_white(complex c, int max_iter) { complex z = inject(0.0); int i; for(i=0; i< max_iter ; i++) { complex tmp = z; z = the_fun(c,z); cdelete(tmp); if (module(z) > 2.0) { cdelete(z); return '*'; } } cdelete(z); return ' '; } static double undiscretize(int i,double squaresize) { return ((double)(i)/squaresize)*4.0 - 2.0; } void display_square(int squaresize,int maxiter){ int i; int j; double d = (double) squaresize; for(i=0;i