Last active
February 19, 2018 17:14
-
-
Save digarok/6740768dedd5775b1cdbe141c1d7ac50 to your computer and use it in GitHub Desktop.
ARCHIMEDES SPIRAL from Analog Magazine, adapted for Apple II
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 REM ARCHIMEDES SPIRAL | |
110 REM | |
120 REM ANALOG MAGAZINE | |
130 REM | |
140 HGR2: HCOLOR =3:XS=0.85:YS=0.9 | |
150 XP=139:XR=4.71238905:XF=XR/XP | |
160 FOR ZI=-64 TO 64 | |
170 ZT=ZI*2.25:ZS=ZT*ZT | |
180 XL=INT(SQR(20736-ZS)+0.5) | |
190 FOR XI=0-XL TO XL | |
200 XT=SQR(XI*XI+ZS)*XF | |
210 YY=(SIN(XT)+SIN(XT*3)*0.4)*56 | |
220 X1=XI+ZI+160:Y1=90-YY+ZI-1 | |
225 X1=X1*XS: Y1=Y1*YS : REM SCALED A BIT FOR HGR RESOLUTION | |
230 HPLOT X1,Y1 | |
235 REM COMMENT THE NEXT LINE TO MAKE IT SEE-THROUGH (ALSO FASTER DRAW) | |
240 HCOLOR=0:HPLOT X1,Y1+1 TO X1,191: HCOLOR =3 | |
250 NEXT XI:NEXT ZI | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment