Listing of file='Inscribe' on disk='vmedia/2282_graphics_crt_demos.wvd.zip'
# Sector 101, program filename = 'Inscribe'
0000 DEFFN '0 "LIST S D 10, 9999"; HEX(0D)
0001 DEFFN '1 "RENUMBER 10-9999, 10, 10"; HEX(0D)
0004 DEFFN '4 "SCRATCH T "; HEX(22); "Inscrib"; HEX(22); " : SAVE T $ () "; HE
X(22); "Inscrib"; HEX(220D)
0010 REM "`Inscrib" 12/27/78 T Smith
0020 REM % Variables
0030 REM R is current radius of the "circle"
0040 REM R0 is the minimum radius
0050 REM R1 is the step size of the radius (in radii)
0060 REM R9 is the maximum radius
0070 REM S0 is the step size of the innermost circle (in circles)
0080 REM S9 is the step size of the outermost circle (in circles)
0090 REM X is X co-ordinate of center
0100 REM Y is Y co-ordinate of center
0110 REM % Init
0120 R0 = 10
0130 R1 = 1/5
0140 R9 = 512*(1-R1)/2
0150 S0 = 1/20
0160 S9 = 1/200
0170 X = 400
0180 Y = 256
0190 SELECT G, PLOT C16
0200 $OPEN /C16
0210 PLOT <,, HEX(E503)>
0220 REM % Main line
0230 R = R9
0240 GOSUB '101 (R)
0250 R = R * (1-R1)
0260 IF R > R0 THEN 240
0270 R = R0
0280 GOSUB '101 (R)
0290 R = R * (1+R1)
0300 IF R < R9 THEN 280
0310 GOTO 230
0320 REM % Plot then unplot
0330 DEFFN '101 (R)
0340 PLOT <,, HEX(E1)>
0350 GOSUB '102 (R)
0360 PLOT <,, HEX(E2)>
0370 GOSUB '102 (R)
0380 RETURN
0390 REM % Plot a class of circles with constant radius
0400 DEFFN '102 (R)
0410 FOR I = FN S(R) TO 1 STEP FN S(R)
0420 GOSUB '103 (I, R)
0430 NEXT I
0440 RETURN
0450 REM % Plot a circle
0460 DEFFN '103 (I, R)
0470 PLOT <,, R>, <X+R, Y,>
0480 X1 = R
0490 Y1 = 0
0500 FOR J = 0 TO (1+I)*400 STEP I*400
0510 X2 = ROUND((COS(J)*R, 0)
0520 Y2 = ROUND((SIN(J)*R, 0)
0530 PLOT <X2-X1, Y2-Y1, D>
0540 X1 = X2
0550 Y1 = Y2
0560 NEXT J
0570 RETURN
0580 REM % Fudge for making small circles plot faster
0590 DEFFN S(R) = 1 / ((R-R0)/(R9-R0)/S9 + (R9-R)/(R9-R0)/S0)