#define MINSTEPS 100 /* min for locus graph */ #define MAXSTEPS 100000 /* max for locus graph */ #define FRSTEPS 100 /* for freq response */ #define XYPIXELS 400 #define BORDER 40 #define TICKLEN 5 #define PHEPS 1e-20 union word /* for error msgs */ { int i; void *p; word(int ix) { i = ix; } word(void *px) { p = px; } }; global char *progname; enum { unknown, locus, phmag, impulse, step } gtype; /* type of graph */ char *outfn; double alpha1, alpha2, logmin; bool logopt, dflag; double xcoeffs[MAXPZ+1], ycoeffs[MAXPZ+1]; int npoles, nzeros, nirsteps; void readcmdline(char*[]); double getfarg(char*); int getiarg(char*); void usage(); void drawgraph(); void computefr(complex[], int); void computeir(double[], int, bool); void locusgraph(char*, complex[], int, double&); int xmap_lc(double), ymap_lc(double); void frgraph(char*, complex[], int); void irgraph(char*, double[], int); void pgraph(gdImagePtr, double[], int, int, bool); void draw_xtick(gdImagePtr, double, double, int, int, char*, double = 0.0); void draw_ytick(gdImagePtr, double, double, int, int, char*, double = 0.0); int xmap_pm(double); int ymap_pm(double); char *choosefmt(double, double); int newhandler(size_t size); void giveup(char*, word = 0);