8-Bit Software Online Conversion
:0.$.CURVMUK - Listing
70MODE2
80VDU19,0,4,0,0,0
90REPEAT
100PROCinput
110PROCinitialise
120PROCplot
130PRINT"press a key ";
140A$=GET$:IF A$="D":*GDUMP
150UNTIL A$="E"
160END
170:
180DEFPROCinitialise
190step=0.02
200IF a>15 OR b>15 THEN step=0.002
210m=0.1E-30
220FOR z=0 TO 2*PI STEP 0.1
230r=ABS(FNequation)
240IF m<r THEN m=r+step
250NEXT
260ENDPROC
270:
280DEFPROCinput
290CLS
300PRINTTAB(20,5)"1..R=1"
310PRINTTAB(20)"2..R=SIN(Z)"
320PRINTTAB(20)"3..R=SIN(5*Z)"
330PRINTTAB(20)"4..R=1+2*COS(Z)"
340PRINTTAB(20)"5..R=1+COS(Z)"
350PRINTTAB(20)"6..R=1+SIN(2*Z)"
360PRINTTAB(20)"7..R=1+2*COS(2*Z)"
370INPUT''"Enter a number (1-7)"n
380IF n<1 OR n>7 THEN GOTO 290
390INPUT"A = "a
400INPUT"B = "b
410ENDPROC
420:
430DEFPROCplot
440CLS
450FOR z=0 TO 2*PI+step STEP step
460r=FNequation
470X%=640+512*COS(a*z)*r/m
480Y%=512+512*SIN(b*z)*r/m
490IF z=0 THEN MOVE X%,Y%
495GCOL0,RND(7)
500DRAW X%,Y%
510NEXT z
520ENDPROC
530:
540DEFFNequation
550IF n=1 =1
560IF n=2 =SIN(z)
570IF n=3 =SIN(5*z)
580IF n=4 =2*COS(z)
590IF n=5 =1+COS(z)
600IF n=6 =1+SIN(2*z)
610=1+2*COS(2*z)