20 R = R: REM :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
30 REM 191 COLONS AFTER REM IN LINE 20
40 REM CHANGE VALUE OF PL (LINE 10) IF LINE 10 OR 20 IS CHANGED
50 RETURN
100 REM **********************
110 REM * POLAR.PLOTTER *
120 REM * BY MARK JESKE *
130 REM * COPYRIGHT (C) 1986 *
140 REM * BY MICROSPARC, INC *
150 REM * CONCORD, MA 01742 *
160 REM **********************
170 DIM R$(25),T(25)
180 FOR L = 1 TO 25
190 READ R$(L): READ T(L)
200 IF R$(L) = "END" THEN 220
210 NEXT L
220 GOTO 420
230 HGR : HCOLOR= 3
240 HPLOT 139,0 TO 139,159
250 HPLOT 0,79 TO 279,79
260 HPLOT 0,0 TO 279,0 TO 279,159 TO 0,159 TO 0,0
270 FOR A = 0 TO 6.4 STEP .05
280 EF = 1: GOSUB 20:EF = 0
290 X = R * COS(A)
300 Y = R * SIN(A)
310 X = X *SC
320 Y = Y *SC
330 Y = -Y
340 IF X < -139 THEN X = -139
350 IF X >140 THEN X = 140
360 IF Y < -79 THEN Y = -79
370 IF Y >80 THEN Y = 80
380 IF A = 0 THEN HPLOT X +139,Y +79: GOTO 400
390 HPLOT TO X +139,Y +79
400 NEXT A
410 VTAB 24: PRINT "PLOT FINISHED."
420 PRINT
430 PRINT "ENTER EQUATION OR <RETURN> TO REUSE."
440 INPUT "R=";E$
450 IF E$ = "END" THEN GOSUB 1080: TEXT : HOME : END
460 IF E$ = "" THEN 610
470 E$ = "R=" +E$: IF LEN(E$) >200 THEN VTAB 21: HTAB 1: CALL -958: VTAB 21: PRINT "EQUATION IS TOO LONG.": PRINT : PRINT "PRESS <RETURN> TO REENTER";: GET Z$: PRINT : HOME : VTAB 21: GOTO 430
480 PK = PL
490 GOSUB 1080
500 FOR L = 1 TO LEN(E$)
510 FOR J = 1 TO 25
520 IF R$(J) = "END" THEN 560
530 IF MID$ (E$,L,1) = R$(J) THEN POKE PK,T(J): GOTO 570
540 IF MID$ (E$,L,3) = R$(J) THEN POKE PK,T(J):L = L +2: GOTO 570
550 NEXT J
560 POKE PK, ASC( MID$ (E$,L,1))
570 PK = PK +1
580 NEXT L
590 POKE PK,58
600 POKE PK +1,178
610 PRINT : INPUT "ENTER SCALE (<RETURN> TO REUSE)? ";S$
1010 IF E = 16 THEN PRINT "SYNTAX ERROR IN LINE "EL: PRINT : PRINT "THERE MAY BE AN ERROR IN YOUR EQUATION.": GOTO 1050
1020 IF E = 53 THEN PRINT "ILLEGAL QUANTITY ERROR IN LINE "EL: PRINT : PRINT "CHECK FOR LOG OF ZERO": PRINT " OR SQUARE ROOT OF NEGATIVE NUMBER.": GOTO 1050
1030 IF E = 133 THEN PRINT "DIVISION BY ZERO ERROR IN LINE "EL: GOTO 1050
1040 PRINT "ERROR "E" IN LINE "EL
1050 VTAB 21: HTAB 1: PRINT "PRESS <RETURN> TO CONTINUE";: GET Z$: PRINT
1060 IF EF THEN HOME : VTAB 12: PRINT "REENTER THE EQUATION": VTAB 21: GOTO 420
1070 TEXT : HOME : END
1080 POKE PL,82: POKE PL +1,208: POKE PL +2,82: POKE PL +3,58: POKE PL +4,178: FOR I = PL +5 TO PL +195: POKE I,58: NEXT : RETURN