/****************************************************************************/ /* (C) Copyright 1993 Universidade Estadual de Campinas (UNICAMP) */ /* Campinas, SP, Brazil */ /* */ /* This file can be freely distributed, modified, and used for any */ /* non-commercial purpose, provided that this copyright and authorship */ /* notice be included in any copy or derived version of this file. */ /* */ /* DISCLAIMER: This software is offered ``as is'', without any guarantee */ /* as to fitness for any particular purpose. Neither the copyright */ /* holder nor the authors or their employers can be held responsible for */ /* any damages that may result from its use. */ /****************************************************************************/ /* See aagraph.h */ #include "aagraph.h" #include "fltgraph.h" #include #include #include #include #include #include #include #include #include /*** INTERNAL PROTOTYPES ***/ void aagraph_plot_aa_graph( FILE *psfile, AAP ff (AAP x), Interval xd, Interval yd, int n ); void aagraph_plot_aa_range_graph( FILE *psfile, AAP ff (AAP x), Interval xd, Interval yd, int n ); void aagraph_plot_ia_graph( FILE *psfile, Interval fv (Interval x), Interval xd, Interval yd, int n ); char *aagraph_format_parms( Interval xd, Interval yd, int n ); /*** IMPLEMENTATIONS ***/ void aagraph_plot_aa_graph( FILE *psfile, AAP ff (AAP x), Interval xd, Interval yd, int n ) { Interval xv, yvlo, yvhi; int xi; AAP xf, yf; double xp[4], yp[4]; AATerm eps[1]; double gray = 0.75; ps_begin_section(psfile, "Plot of AA graph"); for (xi=0; xinterms == 1), "aagraph_plot_aa_graph: xf->nterms != 1"); eps[0].id = ((AATermP)(xf + 1))->id; yf = ff(xf); eps[0].coef = -One; yvlo = aa_range(aa_fix_eps(yf, 1, eps)); eps[0].coef = One; yvhi = aa_range(aa_fix_eps(yf, 1, eps)); if (ia_is_full(&yvlo) || ia_is_full(&yvhi)) { yvlo = yd; yvhi = yd; } ROUND_NEAR; xp[0] = xv.lo; yp[0] = yvlo.lo; xp[1] = xv.hi; yp[1] = yvhi.lo; xp[2] = xv.hi; yp[2] = yvhi.hi; xp[3] = xv.lo; yp[3] = yvlo.hi; ps_fill_and_draw_polygon(psfile, xp, yp, 4, gray); aa_flush(frame); } fprintf(stderr, "\n"); ps_end_section(psfile); } void aagraph_plot_aa_range_graph( FILE *psfile, AAP ff (AAP x), Interval xd, Interval yd, int n ) { Interval xv, yv; int xi; AAP xf, yf; double gray = 0.75; ps_begin_section(psfile, "Plot of AA range graph"); for (xi=0; xi