8-Bit Software Online Conversion
Spirograph - Listing
2 REM ****** TRY THESE *******
3 REM (20,5,10),(20,5,-10)
4 REM (20,5,5),(20,5,-5)
5 MODE 4
10 VDU30
12 INPUT"FIXED RADIUS";f
13 VDU30
16 INPUT"ROTATING RADIUS";m
18 VDU30:PRINT STRING$(30," "):VDU30
20 INPUT"PLOT RADIUS ";r
22 VDU30
25 F$="Y":INPUT"PLOT FIXED COG Y/N";F
$
26 VDU30:PRINT STRING$(30," "):VDU30
28 PRINT TAB(0,31)STR$(f);",";STR$(m)
;",";STR$(r);" ";
29 VDU13
30 a=512:b=640
60 t=ABS(m) MOD ABS(f)
70 d=ABS(r*(1+f/m))+ABS(f+m)
80 s=INT(-2*PI*d)
85 IF t=0 THEN t=m
90 c=ABS(s*(m/t))
100 i=-2*PI/s
102 PLOT69,b,a
105 zx=f/m*2
110 angle=0
115 REPEAT
120 angle=angle+i
130 Ca=(f+m)*COS(angle)
140 Sa=(f+m)*SIN(angle)
160 rot=angle*zx
170 Cb=r*COS(rot)
180 Sb=r*SIN(rot)
310 X=INT(b+(Ca*10)+(Cb*10))
320 Y=INT(a+(Sa*8)+(Sb*8))
330 PLOT69,X,Y
332 IF F$="N" THEN GOTO 340
335 PLOT69,SIN(angle)*f*10+b,COS(angle
)*f*8+a
340 c=c-1
345 UNTIL c=0
350 GOTO 10