Compucolor.org – Virtual Media

Listing of file='XYPLOT.BAS;01' on disk='vmedia/taylor_4-sector.ccvf'

1 PLOT 12,30,16,29,17:PRINT "PLOTTING PROGRAM"
2 PRINT :PRINT "THE PROGRAM HAS FNY(X)=SIN(X/P2)/(X/P2) FOR DEMO"
3 PRINT :PRINT "MIN. AND MAX. VARIABLE ANGLES MUST BE ENTERED IN RADIANS"
11 PRINT :PLOT 15
19 PI= 3.14159:P2= 180/ PI
100 DEF FN Y(X)= SIN (X/ P2)
120 PRINT "IS THE FUNCTION TO BE PLOTTED IN LINE 100? (Y/N) ";
125 PLOT 29,23
130 INPUT T$:PRINT :PRINT
135 T$= LEFT$ (T$,1)
140 IF T$= "Y"GOTO 400
150 PLOT 29,17
200 PRINT "ENTER A FUNCTION AND RE-RUN"
240 GOTO 3020
400 PRINT "ENTER RANGE OF X (SMALLEST X, LARGEST X)";
410 INPUT X1,X2
415 PRINT
420 PRINT "ENTER RANGE OF Y (SMALLEST Y, LARGEST Y) ";
430 INPUT Y1,Y2
500 X0= 10
510 Y0= 10
520 I1= 100
530 I2= 100
540 X3= I1/ (X2- X1)
550 Y3= I2/ (Y2- Y1)
590 REM
1000 PLOT 12
1005 PLOT 29,17
1010 PLOT 2
1100 REM
1110 PLOT 250
1120 PLOT X0,Y0,X0+ I1
1130 PLOT 255,29,22,2,250,X0
1140 FOR I= 1TO 10:PLOT Y0+ I* 10:PLOT X0+ I1:NEXT I
1150 PLOT 255,29,17,2
1200 REM
1210 PLOT 246
1220 PLOT Y0,X0,Y0+ I2
1224 PLOT 255,29,22,2,246,Y0
1226 FOR I= 1TO 10:PLOT X0+ I* 10:PLOT Y0+ I2:NEXT I
1230 PLOT 255,29,19
1250 PLOT 3,4,30:PRINT X1
1260 PLOT 3,25,30:PRINT "X - AXIS"
1265 PLOT 3,54,30:PRINT X2
1270 PLOT 3,20,31:PRINT "X INCREMENT = ";(X2- X1)/ 10
1280 PLOT 3,0,27:PRINT Y1
1283 Y5= (Y2- Y1)/ 10
1284 D$= STR$ (Y5)
1290 PLOT 3,0,10,27,10:PRINT "Y - AXIS";
1300 PLOT 3,2,7:PRINT "Y INCREMENT =";D$;:PLOT 27,11
1350 PLOT 3,0,2:PRINT Y2
1375 PLOT 29,20
1400 PLOT 3,25,0:PRINT "X - Y PLOT"
1500 PLOT 3,0,0
1900 PLOT 29,18,2
2000 REM
2005 PLOT 253
2010 FOR X= 1TO I1:X5= (X/ X3+ X1):IF X5< > 0THEN 2030
2020 X5= .00001
2030 A= INT ((FN Y(X5)- Y1)* Y3+ Y0)
2040 IF A> Y0+ I2THEN 2100
2050 IF A< Y0THEN 2100
2060 PLOT X+ X0
2070 PLOT A
2080 PLOT 242
2100 NEXT X
3000 REM
3010 PLOT 255
3015 PLOT 8,29,17
3020 END