BSD 4_2 release
[unix-history] / usr / src / usr.lib / libplot / t4014 / subr.c
CommitLineData
fac045f8 1#ifndef lint
0f4556f1 2static char sccsid[] = "@(#)subr.c 4.1 (Berkeley) 6/27/83";
fac045f8
SL
3#endif
4
5#include <stdio.h>
6float obotx = 0.;
7float oboty = 0.;
8float botx = 0.;
9float boty = 0.;
10float scalex = 1.;
11float scaley = 1.;
12int scaleflag;
13
14int oloy = -1;
15int ohiy = -1;
16int ohix = -1;
17int oextra = -1;
18cont(x,y){
19 int hix,hiy,lox,loy,extra;
20 int n;
21 x = (x-obotx)*scalex + botx;
22 y = (y-oboty)*scaley + boty;
23 hix=(x>>7) & 037;
24 hiy=(y>>7) & 037;
25 lox = (x>>2)&037;
26 loy=(y>>2)&037;
27 extra=x&03+(y<<2)&014;
28 n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12;
29 if(hiy != ohiy){
30 putch(hiy|040);
31 ohiy=hiy;
32 }
33 if(hix != ohix){
34 if(extra != oextra){
35 putch(extra|0140);
36 oextra=extra;
37 }
38 putch(loy|0140);
39 putch(hix|040);
40 ohix=hix;
41 oloy=loy;
42 }
43 else{
44 if(extra != oextra){
45 putch(extra|0140);
46 putch(loy|0140);
47 oextra=extra;
48 oloy=loy;
49 }
50 else if(loy != oloy){
51 putch(loy|0140);
52 oloy=loy;
53 }
54 }
55 putch(lox|0100);
56 while(n--)
57 putch(0);
58}
59
60putch(c){
61 putc(c,stdout);
62}