// c++ -std=c++11 AteSuFacMap.cc -O2 -o AteSuFacMap
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
using namespace std;
#include <complex>
typedef complex<double> z_type;
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
 #include"ado.cin"
 #define M(x,y) fprintf(o,"%6.4f %6.4f M\n",1.*(x),1.*(y));
 #define L(x,y) fprintf(o,"%6.4f %6.4f L\n",1.*(x),1.*(y));
//#include "Conrec6.cin"
//#include "fac.cin"
//#include "SuFac.cin"
#include "SuExq2.cin"
#include "fslog.cin"
//#include "filog.cin"
int main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d;
FILE *o;o=fopen("AteSuExq2plot.eps","w");ado(o,708,408);
fprintf(o,"104 4 translate\n 100 100 scale\n");

for(m=-1;m<7;m++){M(m,0)L(m,4)}
for(n=0;n<5;n++){M(-1,n)L(6,n)}
//M(0,.8)L(3,.8) // horisontal line
M(-0.8,0)L(3+.2,.8+3+.2)
M(2,0)L(6,4)
fprintf(o,"2 setlinecap .0012 W 0 0 0 RGB S\n");

for(m=-10;m<57;m++) {	x=.1*(m-.6);
			//c=superfac(x); //SuFac
			c=F45E(x); // if(abs(c)>1.e28) break;
			c=FSLOG(c); // ate
			y=Re(c); if(m==-10) M(x,y) else L(x,y)
 		}
fprintf(o,".016 W 0 0 1 RGB S\n");

/*
for(m=0;m<30;m++) {	x=.1*(m-.2);
			c=superfac(x); //SuFac
			c=FSLOG(c); // ate
			y=Re(c)-x; 
			if(m==0) M(x,y) else L(x,y)
 		}
fprintf(o,".01 W 0 0 1 RGB S\n");
*/

fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
     system("epstopdf AteSuExq2plot.eps"); 
     system(    "open AteSuExq2plot.pdf"); //for mac
}
