Annotation of researchv10no/libplot/libpen/range.c, revision 1.1.1.1

1.1       root        1: #include "pen.h"
                      2: range(x0, y0, x1, y1)
                      3: double x0, y0, x1, y1;
                      4: {
                      5:        double dx, dy, step;
                      6:        if(noscale){
                      7:        dx = x1 - x0;
                      8:        dy = y1 - y0;
                      9:        if(dx <= 2. || dy <= 2.)
                     10:                e1->scale = 1000.;
                     11:        else if(dx <= 100. || dy <= 100.)
                     12:                e1->scale = 100.;
                     13:        else e1->scale = 1.;
                     14:        if(!res){
                     15:                dx *= e1->scale;
                     16:                dy *= e1->scale;
                     17:                step = (((dy*DX)/dx)>DY) ? DY/dy : DX/dx;       
                     18:                e1->p2x = e0->p1x + dx*step;
                     19:                e1->p2y = e0->p1y + dy*step;
                     20:                fprintf(pltout,"IP %8.2f,%8.2f %8.2f,%8.2f\n",
                     21:                          e1->p1x,e1->p1y,e1->p2x,e1->p2y);
                     22:                        DX = e1->p2x - e1->p1x;
                     23:                        DY = e1->p2y - e1->p1y;
                     24:                        res = 1;
                     25:        }
                     26:        }
                     27:        e1->xmin = SCX(x0);
                     28:        e1->ymin = SCY(y0);
                     29:        e1->xmax = SCX(x1);
                     30:        e1->ymax = SCY(y1);
                     31:        fprintf(pltout,"SC %8.2f,%8.2f %8.2f,%8.2f\n",
                     32:                e1->xmin,e1->xmax,e1->ymin,e1->ymax);
                     33:        ckerr(1);
                     34: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.