12-23-2006, 07:10 AM
I don't remember where I got this original program, but, it is amazing, in that just 9 lines produce such a complex result!
If this program was previously posted here, my apologies. Not knowing this, I venture to post it, as I think it is very good!
Aspect ratio was too high, so, I added my own aspect ratio multiplier, ar, to get closer to a true circle
The program consists of simply drawing a line and a point, over and over again. To watch this, just unremark the 'SLEEP that I've added, between lines 7 and 8, and press the Space bar to see the performance, one drawn line and point at a time.
When running the program with the 'SLEEP remarked out, you will see the wreath turn counterclockwise for about 6 seconds, then clockwise for another 6 seconds, then counterclockwise for a long time... All with the repetitious drawing of a line and a point! It is a really amazing result!
If this program was previously posted here, my apologies. Not knowing this, I venture to post it, as I think it is very good!
Aspect ratio was too high, so, I added my own aspect ratio multiplier, ar, to get closer to a true circle
The program consists of simply drawing a line and a point, over and over again. To watch this, just unremark the 'SLEEP that I've added, between lines 7 and 8, and press the Space bar to see the performance, one drawn line and point at a time.
When running the program with the 'SLEEP remarked out, you will see the wreath turn counterclockwise for about 6 seconds, then clockwise for another 6 seconds, then counterclockwise for a long time... All with the repetitious drawing of a line and a point! It is a really amazing result!
Code:
ar = 1.33
1 SCREEN 13
2 FOR x = 0 TO ATN(1) * 8 STEP ATN(1) / 2
3 c = (c + 1) MOD 16
4 a = a - ATN(1) / 90
5 LINE (160 + ar*COS(a - x) * 70, 100 + SIN(a - x) * 70)-(160 + ar*COS(ATN(1) * 2 + x) * 70, 100 + SIN(ATN(1) * 2 + x) * 70), c MOD 8
6 LINE (160 + ar*COS(a - x) * 50, 100 + SIN(a - x) * 50)-(160 + ar*COS(ATN(1) * 2 + x) * 50, 100 + SIN(ATN(1) * 2 + x) * 50), a MOD 8
7 PSET (COS(RND * ATN(1) * 8) * (RND * 30 + 70) + 160, SIN(RND * ATN(1) * 8) * (RND * 30 + 70) + 100), RND * 255
'SLEEP
8 NEXT x
9 GOTO 2
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.