Fast, easy fractal displays
Dot-Hopper is a short fractal display program that places dots onscreen according to mathematical formulas which can be varied by the user This BASIC program works on all 8-bit Atari computers of any memory size, with disk or cassette. However your fractal pictures can only be saved to disk.
The Professor's pooch got into the cupboard
again. Crash! There went the blackstrap molasses-all over the white linoleum
floor. Intrigued by the sticky mess, Gerfald the flea hopped off his canine
mount to investigate.
"Slurp!" A tiny white dot of linoleum appeared in the sea of molasses. Hopping for joy, Gerfald continued sampling his find. Because he used to be a math major at the University of Tiny Offensive Creatures, our busy gourmand hopped according to a mathematical formula. Slowly a pattern appeared as more linoleum was licked clean.
Later, while gloomily surveying the results of doggie destruction, the Professor pondered over his seemingly self-cleaning floor. With his Atari magnifying glass in hand, the astonished scientist discovered Gerfald slurping his way to fame (and obesity)-in a precise pattern. "I'm rich!" exclaimed the Professor. "Ha, ha, ha, ha!"
Help Gerfald the superintelligent flea slurp his way-in a mathematically precise pattern-through a sticky sea of molasses to create fractal pictures such as this one. Evidently GerfaId prefers the taste of the molasses splattered by the Professor's accident-prone dog to that of the dog himself-and the Prof prefers lots of money to none at all.
Congratulations, you were hired to help train Gerfald for flea stardom. You have six parameters to tell him how to hop, so go to it. Type in Listing 1, HOP.BAS, check it with TYPO II and SAVE a copy before you RUN it.
Press [C] to create a fractal pattern. Press [S] to SAVE the pattern to disk. Press [L] to LOAD the fractal picture back from disk. Press [ESC] to return to the menu and start again. Pressing the [SPACEBAR] once turns off the screen display and speeds up things by about 30%. Pressing it again restores the display.
You might want to experiment with Gerfald's formula on line 40. Special functions like like SQR, SIN, COS, EXP and raising a variable to a power (such as A^B) slow things down a tad. In place of l/(l + X^2), for example, try 1/(1 + X * X) instead.
There are six parameters: Scale is a magnification factor that lets you zoom in or out. X0 and Y0 let you specify where you want to examine the X-Y axis. Finally A, B and C are the variables needed to generate the pattern.
This month, Antic Disk owners will find a sample fractal pattern, PIC1, which can be loaded from Dot-Hopper. PIC1 was created with these formulas:
The parameters required to produce these patterns are also included in the Dot-Hopper program. Graphics 8 is used for maximum resolution, and the calculations are done at the start of the program listing (lines 20-60) to speed up execution.
Douglas Skrecky lives in Toronto, Canada, where he is a member of the Toronto Atari Federation users group. This is his first publication in Antic.
IF YOU'D ENJOY SEEING MORE ARTICLES LIKE THIS ONE, CIRCLE 207 ON THE READER SERVICE CARD.
Listing 1:HOP.BAS Download