/******************************************* * Copyright (C) 1990 by Christopher R. Wren and * the Massachusetts Institute of Technology * * COMMERCIAL DISCLAIMER: * * This software is intended for research purposes only and contains * unlicensed software, in original and modified forms, from various * sources including the Free Software Foundation. These programs * shall not be used, rewritten, or adapted as the basis of a * commercial software or hardware product without first obtaining * appropriate licenses from the owners of the original software * copyrights. * * In the case of copyrighted software fragments obtained from the * Free Software Foundation: you can redistribute it and/or modify it * under the terms of the GNU Library General Public License as * published by the Free Software Foundation. This software is * distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General * Public License for more details. You should have received a copy * of the GNU Library General Public License and the GNU General * Public License along with this software; if not, write to the Free * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * Developed by Christopher R. Wren at the * Media Laboratory, MIT, Cambridge, Massachusetts. * *******************************************/ #include #include #include #include #include #include #define DEG * .0174532925199 #define sq(n) (n)*(n) #define gray(lvl) lvl,lvl,lvl main(argc,argv) int argc; char *argv[]; { float xupper; float xlower; float yupper; float ylower; float yinc; float xinc; int width, height; int x,y,i; int RESO,RESO2; int Fx,Fy,Lx,Ly; double xma; int fildes,dum; float c[2][3],d[3]; float dummy[6]; int cmapsize; FILE *datafile, *fopen(); char q; char t,t1,type(); void output(); if (argc == 9) { if (!strcmp(argv[1],"-")) { datafile = stdout; } else { datafile = fopen(argv[1],"w+"); } width = (int) atoi(argv[2]); height = (int) atoi(argv[3]); xlower = (float) atof(argv[4]); ylower = (float) atof(argv[5]); xupper = (float) atof(argv[6]); yupper = (float) atof(argv[7]); RESO = (int) atoi(argv[8]); xinc = (xupper-xlower)/width; yinc = (yupper-ylower)/height; fprintf(datafile, "%f %f %f %f %d %d %d\n", xupper, ylower, xupper, yupper, width, height, RESO); { char c; int LASTPASS = 0; for(y=0;y D && (i<256)) { i++; y.r = x.r; y.i = x.i; z=Cdiv(Csub(Cpow(x,4),Complex(1.0,0.0)), RCmul(4.0,Cpow(x,3))); x = Csub(y,z); } return i; } int iter( a,b) float a,b; { int i=0; fcomplex x; float D=2.0; x=Complex(0.0,0.0); while ((Cabs(x) < D) && (i<256)) { i++; x=Cadd(Cpow(x,2),Complex(a,b)); } return i; }