280 REM   AUTHOR:  TOM SPEER             24 NOV 1983
290 REM  ************* SAMPLE PROGRAM SHOWING PLOT OF FILLED SINEWAVE *******
300 DIM X(20),Y(20)
310 N%=20
320 PI=6.28318/N%
330 FOR I%=1 TO N%
340 A=PI*I%
350 X(I%)=COS(A)*.49+.5
360 Y(I%)=SIN(A)*.49+.5
370 NEXT I%
380 REM 
390 REM SET UP PLOT
400 INPUT "PLOT POLYGON";Y$
410 IF LEFT$(Y$,1)<>"Y" GOTO 580
420 REM
430 REM PLOT POLYGON
440 REM
450 FOR I%=1 TO N%
460 FOR J%=I% TO N%
470 X1=X(I%):Y1=Y(I%):X2=X(J%):Y2=Y(J%)
480 GOSUB 176
490 NEXT J%
500 NEXT I%
510 REM
520 GOSUB 194
530 GC%=0:GOSUB 186
540 GC%=127:GOSUB 183
550 PRINT "POLYGON PLOTTED"
560 REM
570 REM PLOT SINE CURVE
580 INPUT "PLOT SINE CURVE";Y$
590 IF LEFT$(Y$,1)<>"Y" GOTO 760
600 REM
610 MB=.1:MT=.1:MR=.1:ML=.1
620 XL=0:XR= 10:YB=-1:YT=1:DX= 2:DY=.2
630 NX%=3:NY%=3
640 LX%=-1
650 GOSUB 272: REM PLOT GRID
660 YF=FN RY(0)
665 GC%=96: GOSUB 182 : REM SET COLOR CODE
670 Y1=1-MT:GL$="E^(-T/5) * SIN (T)":X1=.5-LEN(GL$)/2*CX:GOSUB 188
690 X1=FN RX(0):Y1=FN RY(0)
700 FOR T=0 TO 10 STEP .2
710 X2=FN RX(T):Y2=FN RY(EXP(-T/5)*SIN(T))
720 GOSUB 190: REM FILL AREA TO X AXIS
730 X1=X2:Y1=Y2
740 NEXT T
741 GC%=127:GOSUB 182:REM SET COLOR TO BLACK
742 X1=FN RX(0):Y1=FN RY(0)
743 FOR T=0 TO 10 STEP .2
744 X2=FN RX(T):Y2=FN RY(EXP(-T/5)*SIN(T))
745 GOSUB 176: REM PLOT EDGE AROUND FILLED AREA
746 X1=X2:Y1=Y2:NEXT T
750 GOSUB 194: REM PRINT PLOT
760 GC$="Q":GOSUB 198
770 END
