//*************************************// //******** created by mamo139 *********// //*** http://mamo139.altervista.org ***// //*************************************// #include #include #include //*** strumenti genstione numeri complessi ***// struct complesso { double r; double i; }; //*** strumenti gestione db int ** crea_matrice(long x, long y); void scrivi_matrice(char * file_name, int ** matrice, long xl, long yl); //*** MAIN ***// int main (void){ char db_name[]="ma"; //*********** PARAMETRI *************// long larghezza = 2000; long altezza = 2000; long deep = 10000; double y1 = 2; double x0 = -2, x1 = 2; double y0 = -2; //**********************************// //aggiustamento parametri double agg_temp; agg_temp=y1; y1=y0*(-1); y0=agg_temp*(-1); //**********************************// int ** matrice; matrice = crea_matrice(larghezza,altezza); //inizio elaborazione immagine long x,y,d,i; double real_x,real_y, colore; struct complesso z,c,temp; for(x=0;x 4) { d = i; break; } temp.r = z.r; temp.i = z.i; z.r = (temp.r*temp.r) - (temp.i*temp.i) + c.r; z.i = (temp.r*temp.i)*2 + c.i; } matrice[x][y] = d; } printf("%d%%\n",x*100/larghezza); } scrivi_matrice(db_name,matrice,larghezza,altezza); printf("fine!"); getchar(); return 0; } //****** FUNZIONI *******// int ** crea_matrice(long x, long y){ int ** array; int i, j; array = (int**)malloc(x * sizeof(int *)); for(i=0; i