Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50110/plot.uti
There are 2 other files named plot.uti in the archive. Click here to see a list.
100'  NAME--PLOT
110'
120'  DESCRIPTION--PRINTS OUT A GRAPH OF ANY NUMBER OF POINTS (X,Y)
130'  WHICH ARE GIVEN AS DATA. THE SCALE ON THE X AND Y AXES ARE THE
140'  THE SAME. THE AXES ARE AUTOMAICALLY PLOTTED. IT IS POSSIBLE
150'  TO HAVE THE LINES Y=C1 AND X=C2 PLOTTED, INSTEAD OF THE
160'  USUAL X AND Y AXES. THE GRAPH IS SIX INCHES SQUARE.
170'
180'  SOURCE--RONALD FAGIN '67
190'
200'  INSTRUCTIONS--THE DATA BLOCK STARTS ON LIN 2000. GIVE AS
210'  DATA FIRST N, THE NUMBER OF POINTS, AND THEN THE COORDINATES
220'  OF THE POINTS X(1),Y(1),X(2),Y(2),.....X(N),Y(N).
230'  IF IT IS DESIRED THAT THE LINE Y=C1 BE PLOTTED INSTEAD OF
240'  THE X-AXIS, AND X=C2 INSTEAD OF THE Y-AXIS, TYPE
250'         320 LET A=C1
260'         330 LET B=C2
270'  WHERE C1 AND C2 ARE FIXED NUMBERS. SAMPLE DATA START IN LINE 2000.
280'
290'
300'  *  *  *  *  *  *  *  *  MAIN PROGRAM  *  *  *  *  *  *  *  *  *
310'
340 DIM M(60,61),X(200),Y(200)
350 LET S=60
360 READ N
370 FOR I=1 TO N
380 READ X(I),Y(I)
390 NEXT I
400 LET M1=N1=X(0)=B
410 LET M2=N2=Y(0)=A
420 FOR I=1 TO N
430 IF X(I)<N1 THEN 450
440 LET N1=X(I)
450 IF X(I)>M1 THEN 470
460 LET M1=X(I)
470 IF Y(I)<N2 THEN 490
480 LET N2=Y(I)
490 IF Y(I)>M2 THEN 510
500 LET M2=Y(I)
510 NEXT I
520 IF N2-M2<=N1-M1 THEN 590
530 LET T=INT((N2-M2-N1+M1)/2+.5)
540 IF N1>=B THEN 580
550 LET N1=N1+T
560 LET M1=M1-T
570 GOTO 590
580 LET N1=N1+2*T
590 LET D=(N1-M1)/S
600 LET S3=INT(.6*S+.5)
610 LET S2=INT((N2-M2)*.6/D+.5)
620 IF S3>S2 THEN 640
630 GOTO 650
640 LET K=INT((S3-S2)/2+.5)
650 LET L=S2+2*K
660 DEF FNG=INT((X(I)-M1)/D+.5)
670 DEF FNH=INT((Y(I)-M2)*.6/D+.5)
680 LET I=0
690 LET K1=FNG
700 LET K2=K+FNH
710 FOR I=0 TO S
720 IF(I-K1)/5<>INT((I-K1)/5) THEN 740
730 LET M(K2,I)=1
740 LET M(K2,I)=M(K2,I)+2
750 NEXT I
760 FOR I=0 TO L
770 IF (I-K2)/5<>INT((I-K2)/5) THEN 790
780 LET M(I,K1)=1
790 LET M(I,K1)=M(I,K1)+2
800 NEXT I
810 LET M(K2,K1)=4
820 LET M(K2,S+1)=1
830 FOR I=1 TO N
840 LET M(FNH+K,FNG)=5
850 NEXT I
860 IF A*A+B*B=0 THEN 910
870 PRINT "THE X-AXIS IS THE LINE Y=";A
880 PRINT
890 PRINT "THE Y-AXIS IS THE LINE X=";B
900 PRINT
910 PRINT "EACH SPACE ON THE X-AXIS REPRESENTS";D
920 PRINT
930 PRINT "EACH SPACE ON THE Y-AXIS REPRESENTS";5*D/3
940 PRINT
950 PRINT "ONE INCH IN ANY DIRECTION REPRESENTS";10*D
960 FOR I=1 TO 5
970 PRINT
980 NEXT I
990 PRINT TAB(K1);"Y"
1000 FOR I=L TO 0 STEP -1
1010 FOR J=0 TO S+1
1020 ON M(I,J)+1 GOTO 1030,1050,1070,1090,1110,1130
1030 PRINT " ";
1040 GOTO 1140
1050 PRINT "X";
1060 GOTO 1140
1070 PRINT "-";
1080 GOTO 1140
1090 PRINT "+";
1100 GOTO 1140
1110 PRINT "O";
1120 GOTO 1140
1130 PRINT "*";
1140 FOR Q=J+1 TO S+1
1150 IF M(I,Q)>0 THEN 1180
1160 NEXT Q
1170 GOTO 1190
1180 NEXT J
1190 PRINT
1200 NEXT I
1210 FOR I=1 TO 10
1220 PRINT
1230 NEXT I
2000 DATA 41
2010 DATA 1,0,.951,.309,.809,.588,.588,.809,.309,.951,0,1
2020 DATA -.309,.951,-.588,.809,-.809,.588,-.951,.309,-1,0
2030 DATA -.951,-.309,-.809,-.588,-.588,-.809,-.309,-.951,0,-1
2040 DATA .309,-.951,.588,-.809,.809,-.588,.951,-.309
2050 DATA -1,-1,-1,1,-.8,-.8,-.8,.8,-.6,-.6,-.6,.6,-.4,-.4
2060 DATA -.4,.4,-.2,-.2,-.2,.2,0,0,.2,.2,.2,-.2,.4,.4,.4,-.4
2070 DATA .6,.6,.6,-.6,.8,.8,.8,-.8,1,1,1,-1
2080 END