Annotation of 43BSDTahoe/usr.lib/libplot/aed/space.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1980 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  */
        !             6: 
        !             7: #ifndef lint
        !             8: static char sccsid[] = "@(#)space.c    5.2 (Berkeley) 4/30/85";
        !             9: #endif not lint
        !            10: 
        !            11: 
        !            12: #include "aed.h"
        !            13: 
        !            14: /*---------------------------------------------------------
        !            15:  *     Space sets up the world-to-screen transformation so
        !            16:  *     that the rectangular area described by (x0, y0) and
        !            17:  *     (x1, y1) will all be on-screen.
        !            18:  *
        !            19:  *     Results:        None.
        !            20:  *
        !            21:  *     Side Effects:
        !            22:  *     Our own variables scale, xbot, and ybot are changed.
        !            23:  *---------------------------------------------------------
        !            24:  */
        !            25: space(x0, y0, x1, y1)
        !            26: int x0, y0, x1, y1;
        !            27: {
        !            28:     int xscale, yscale, xsize, ysize;
        !            29:     xscale = (GRXMAX<<12)/(x1-x0);
        !            30:     yscale = (GRYMAX<<12)/(y1-y0);
        !            31:     if (xscale > yscale) scale = yscale;
        !            32:     else scale = xscale;
        !            33:     scale = (scale*9)/10 - 1;
        !            34:     if (scale<1) scale = 1;
        !            35:     xsize = (2048*GRXMAX)/scale + 1;
        !            36:     xbot = (x1+x0)/2 - xsize;
        !            37:     ysize = (2048*GRYMAX)/scale + 1;
        !            38:     ybot = (y1+y0)/2 - ysize;
        !            39: }

unix.superglobalmegacorp.com

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