Init
This commit is contained in:
26
ucbcmd/plot/libplot/bitgraph/Makefile
Executable file
26
ucbcmd/plot/libplot/bitgraph/Makefile
Executable file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
#ident "@(#)Makefile 1.2 92/12/16 SMI"
|
||||
#
|
||||
# Copyright (c) 1989 by Sun Microsystems, Inc.
|
||||
#
|
||||
|
||||
LIBRARY= ../libplotbg.a
|
||||
|
||||
OBJECTS = arc.o box.o circle.o close.o cont.o dot.o erase.o label.o \
|
||||
line.o linemod.o move.o open.o point.o space.o
|
||||
|
||||
# include library definitions
|
||||
include ../../../../lib/Makefile.lib
|
||||
|
||||
BUILD.AR = $(AR) $(ARFLAGS) $@ `$(LORDER) $(AROBJS) | $(TSORT)`
|
||||
|
||||
# TXTS allows the AT&T makefile to be bootstrapped into the NSE.
|
||||
|
||||
CLOBBERFILES= $(LIBRARY)
|
||||
|
||||
.KEEP_STATE:
|
||||
|
||||
all: $(LIBS)
|
||||
|
||||
include ../../../../lib/Makefile.targ
|
||||
|
||||
106
ucbcmd/plot/libplot/bitgraph/arc.c
Executable file
106
ucbcmd/plot/libplot/bitgraph/arc.c
Executable file
@@ -0,0 +1,106 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)arc.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include "bg.h"
|
||||
|
||||
/* should include test for equality? */
|
||||
#define side(x,y) (a*(x)+b*(y)+c > 0.0 ? 1 : -1)
|
||||
|
||||
/* The beginning and ending points must be distinct. */
|
||||
arc(xc,yc,xbeg,ybeg,xend,yend)
|
||||
int xc,yc,xbeg,ybeg,xend,yend;
|
||||
{
|
||||
double r, radius, costheta, sintheta;
|
||||
double a, b, c, x, y, tempX;
|
||||
int right_side;
|
||||
|
||||
int screen_xc = scaleX(xc);
|
||||
int screen_yc = scaleY(yc);
|
||||
|
||||
/* It is more convienient to beg and end relative to center. */
|
||||
int screen_xbeg = scaleX(xbeg) - screen_xc;
|
||||
int screen_ybeg = scaleY(ybeg) - screen_yc;
|
||||
|
||||
int screen_xend = scaleX(xend) - screen_xc;
|
||||
int screen_yend = scaleY(yend) - screen_yc;
|
||||
|
||||
/* probably should check that arc is truely circular */
|
||||
r = sqrt( (double) (screen_xbeg*screen_xbeg + screen_ybeg*screen_ybeg) );
|
||||
|
||||
/*
|
||||
This method is reasonably efficient, clean, and clever.
|
||||
The easy part is generating the next point on the arc. This is
|
||||
done by rotating the points by the angle theta. Theta is chosen
|
||||
so that no rotation will cause more than one pixel of a move.
|
||||
This corresponds to a triangle having x side of r and y side of 1.
|
||||
The rotation is done (way) below inside the loop.
|
||||
|
||||
Note: all calculations are done in screen coordinates.
|
||||
*/
|
||||
if (r <= 1.0) {
|
||||
/* radius is mapped to length < 1*/
|
||||
point(xc,yc);
|
||||
return;
|
||||
}
|
||||
|
||||
radius = sqrt(r*r + 1.0);
|
||||
sintheta = 1.0/radius;
|
||||
costheta = r/radius;
|
||||
|
||||
/*
|
||||
The hard part of drawing an arc is figuring out when to stop.
|
||||
This method works by drawing the line from the beginning point
|
||||
to the ending point. This splits the plane in half, with the
|
||||
arc that we wish to draw on one side of the line. If we evaluate
|
||||
side(x,y) = a*x + b*y + c, then all of the points on one side of the
|
||||
line will result in side being positive, and all the points on the
|
||||
other side of the line will result in side being negative.
|
||||
|
||||
We want to draw the arc in a counter-clockwise direction, so we
|
||||
must find out what the sign of "side" is for a point which is to the
|
||||
"right" of a line drawn from "beg" to "end". A point which must lie
|
||||
on the right is [xbeg + (yend-ybeg), ybeg - (xend-xbeg)]. (This
|
||||
point is perpendicular to the line at "beg").
|
||||
|
||||
Thus, we compute side of the above point, and then compare the
|
||||
sign of side for each new point with the sign of the above point.
|
||||
When they are different, we terminate the loop.
|
||||
*/
|
||||
|
||||
a = (double) (screen_yend - screen_ybeg);
|
||||
b = (double) (screen_xend - screen_xbeg);
|
||||
c = (double) (screen_yend*screen_xbeg - screen_xend*screen_ybeg);
|
||||
right_side = side(screen_xbeg + (screen_yend-screen_ybeg),
|
||||
screen_ybeg - (screen_xend-screen_xbeg) );
|
||||
|
||||
x = screen_xbeg;
|
||||
y = screen_ybeg;
|
||||
move(xbeg, ybeg);
|
||||
do {
|
||||
currentx = screen_xc + (int) (x + 0.5);
|
||||
currenty = screen_yc + (int) (y + 0.5);
|
||||
putchar( ESC );
|
||||
printf(":%d;%dd", currentx, currenty);
|
||||
tempX = x;
|
||||
x = x*costheta - y*sintheta;
|
||||
y = tempX*sintheta + y*costheta;
|
||||
} while( side(x,y) == right_side );
|
||||
}
|
||||
41
ucbcmd/plot/libplot/bitgraph/bg.h
Executable file
41
ucbcmd/plot/libplot/bitgraph/bg.h
Executable file
@@ -0,0 +1,41 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)bg.h 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Displays plot files on a bbn bitgraph terminal.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#define ESC 033
|
||||
#define PI 3.141592659
|
||||
|
||||
/* The graphics address range is 0..XMAX, 0..YMAX. */
|
||||
#define XMAX 768
|
||||
#define YMAX 1024
|
||||
#define scaleX(xi) ((int) ((xi - lowx)*scale +0.5))
|
||||
#define scaleY(yi) ((int) ((yi - lowy)*scale +0.5))
|
||||
|
||||
extern int currentx;
|
||||
extern int currenty;
|
||||
extern double lowx;
|
||||
extern double lowy;
|
||||
extern double scale;
|
||||
30
ucbcmd/plot/libplot/bitgraph/box.c
Executable file
30
ucbcmd/plot/libplot/bitgraph/box.c
Executable file
@@ -0,0 +1,30 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)box.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
box(x0, y0, x1, y1)
|
||||
{
|
||||
move(x0, y0);
|
||||
cont(x0, y1);
|
||||
cont(x1, y1);
|
||||
cont(x1, y0);
|
||||
cont(x0, y0);
|
||||
move(x1, y1);
|
||||
}
|
||||
28
ucbcmd/plot/libplot/bitgraph/circle.c
Executable file
28
ucbcmd/plot/libplot/bitgraph/circle.c
Executable file
@@ -0,0 +1,28 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)circle.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
circle (xc,yc,r)
|
||||
int xc,yc,r;
|
||||
{
|
||||
arc(xc,yc, xc+r,yc, xc-r,yc);
|
||||
arc(xc,yc, xc-r,yc, xc+r,yc);
|
||||
}
|
||||
35
ucbcmd/plot/libplot/bitgraph/close.c
Executable file
35
ucbcmd/plot/libplot/bitgraph/close.c
Executable file
@@ -0,0 +1,35 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)close.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <signal.h>
|
||||
#include "bg.h"
|
||||
|
||||
closepl()
|
||||
{
|
||||
/* recieve interupts */
|
||||
signal(SIGINT, SIG_IGN);
|
||||
|
||||
/* exit graphics mode */
|
||||
putchar( ESC );
|
||||
printf("[H");
|
||||
exit(0);
|
||||
}
|
||||
32
ucbcmd/plot/libplot/bitgraph/cont.c
Executable file
32
ucbcmd/plot/libplot/bitgraph/cont.c
Executable file
@@ -0,0 +1,32 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)cont.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "bg.h"
|
||||
|
||||
cont(xi,yi)
|
||||
int xi,yi;
|
||||
{
|
||||
currentx = scaleX(xi);
|
||||
currenty = scaleY(yi);
|
||||
putchar( ESC );
|
||||
printf(":%d;%dd", currentx, currenty);
|
||||
}
|
||||
24
ucbcmd/plot/libplot/bitgraph/dot.c
Executable file
24
ucbcmd/plot/libplot/bitgraph/dot.c
Executable file
@@ -0,0 +1,24 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)dot.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
dot(){
|
||||
}
|
||||
31
ucbcmd/plot/libplot/bitgraph/erase.c
Executable file
31
ucbcmd/plot/libplot/bitgraph/erase.c
Executable file
@@ -0,0 +1,31 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)erase.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "bg.h"
|
||||
|
||||
erase()
|
||||
{
|
||||
putchar( ESC );
|
||||
printf("[H");
|
||||
putchar( ESC );
|
||||
printf("[J");
|
||||
}
|
||||
27
ucbcmd/plot/libplot/bitgraph/label.c
Executable file
27
ucbcmd/plot/libplot/bitgraph/label.c
Executable file
@@ -0,0 +1,27 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)label.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
label(s)
|
||||
char *s;
|
||||
{
|
||||
printf("%s", s);
|
||||
}
|
||||
36
ucbcmd/plot/libplot/bitgraph/line.c
Executable file
36
ucbcmd/plot/libplot/bitgraph/line.c
Executable file
@@ -0,0 +1,36 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)line.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "bg.h"
|
||||
|
||||
line(x0,y0,x1,y1)
|
||||
int x0,y0,x1,y1;
|
||||
{
|
||||
if(scaleX(x0)==currentx && scaleY(y0)==currenty)
|
||||
cont(x1,y1);
|
||||
else if(scaleX(x1)==currentx && scaleY(y1)==currenty)
|
||||
cont(x0,y0);
|
||||
else{
|
||||
move(x0,y0);
|
||||
cont(x1,y1);
|
||||
}
|
||||
}
|
||||
24
ucbcmd/plot/libplot/bitgraph/linemod.c
Executable file
24
ucbcmd/plot/libplot/bitgraph/linemod.c
Executable file
@@ -0,0 +1,24 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)linemod.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
linemod(){
|
||||
}
|
||||
32
ucbcmd/plot/libplot/bitgraph/move.c
Executable file
32
ucbcmd/plot/libplot/bitgraph/move.c
Executable file
@@ -0,0 +1,32 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)move.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "bg.h"
|
||||
|
||||
move(xi,yi)
|
||||
int xi,yi;
|
||||
{
|
||||
currentx = scaleX(xi);
|
||||
currenty = scaleY(yi);
|
||||
putchar( ESC );
|
||||
printf(":%d;%dm", currentx, currenty);
|
||||
}
|
||||
46
ucbcmd/plot/libplot/bitgraph/open.c
Executable file
46
ucbcmd/plot/libplot/bitgraph/open.c
Executable file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)open.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Displays plot files on a BBN bitgraph terminal.
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include "bg.h"
|
||||
|
||||
int currentx = 0;
|
||||
int currenty = 0;
|
||||
double lowx = 0.0;
|
||||
double lowy = 0.0;
|
||||
double scale = 1.0;
|
||||
|
||||
openpl()
|
||||
{
|
||||
void closepl();
|
||||
|
||||
/* catch interupts */
|
||||
signal(SIGINT, closepl);
|
||||
currentx = 0;
|
||||
currenty = 0;
|
||||
|
||||
space(0, 0, XMAX, YMAX);
|
||||
}
|
||||
28
ucbcmd/plot/libplot/bitgraph/point.c
Executable file
28
ucbcmd/plot/libplot/bitgraph/point.c
Executable file
@@ -0,0 +1,28 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)point.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
point(xi, yi)
|
||||
int xi, yi;
|
||||
{
|
||||
move(xi, yi);
|
||||
label(".");
|
||||
}
|
||||
34
ucbcmd/plot/libplot/bitgraph/space.c
Executable file
34
ucbcmd/plot/libplot/bitgraph/space.c
Executable file
@@ -0,0 +1,34 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)space.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "bg.h"
|
||||
|
||||
space(x0,y0,x1,y1)
|
||||
int x0,y0,x1,y1;
|
||||
{
|
||||
double scalex, scaley;
|
||||
lowx = x0;
|
||||
lowy = y0;
|
||||
scalex = XMAX/(double)(x1-lowx);
|
||||
scaley = YMAX/(double)(y1-lowy);
|
||||
scale = scalex < scaley ? scalex : scaley;
|
||||
}
|
||||
Reference in New Issue
Block a user