1*48511Sbostic /*- 2*48511Sbostic * Copyright (c) 1980, 1986 The Regents of the University of California. 3*48511Sbostic * All rights reserved. 4*48511Sbostic * 5*48511Sbostic * %sccs.include.proprietary.c% 629816Ssklower */ 729816Ssklower 829816Ssklower #ifndef lint 9*48511Sbostic static char sccsid[] = "@(#)space.c 6.2 (Berkeley) 04/22/91"; 10*48511Sbostic #endif /* not lint */ 1129816Ssklower 1229816Ssklower #include "grnplot.h" 1329816Ssklower 1429816Ssklower /*--------------------------------------------------------- 1529816Ssklower * Space sets up the world-to-screen transformation so 1629816Ssklower * that the rectangular area described by (x0, y0) and 1729816Ssklower * (x1, y1) will all be on-screen. 1829816Ssklower * 1929816Ssklower * Results: None. 2029816Ssklower * 2129816Ssklower * Side Effects: 2229816Ssklower * Our own variables scale, xbot, and ybot are changed. 2329816Ssklower *--------------------------------------------------------- 2429816Ssklower */ 2529816Ssklower space(x0, y0, x1, y1) 2629816Ssklower int x0, y0, x1, y1; 2729816Ssklower { 2829816Ssklower double xscale=0.0, yscale=0.0; 2929816Ssklower if (x1>x0) 3029816Ssklower xscale = GRXMAX/(double)(x1-x0); 3129816Ssklower if (y1>y0) 3229816Ssklower yscale = GRYMAX/(double)(y1-y0); 3329816Ssklower scale = (xscale > yscale && yscale > 0)? yscale : xscale; 3429816Ssklower if (scale == 0.0) scale == 1.0; 3529816Ssklower xbot = x0; 3629816Ssklower ybot = y0; 3729816Ssklower } 38