Classic Computer Magazine Archive ANTIC VOL. 6, NO. 10 / FEBRUARY 1988

page 6 Exchange

Sierpinski Curves

Fractal "arrowhead"power display

This short, interesting demonstration listing clearly shows the power of fractal mathematics to create complex, everchanging shapes. The BASIC program works on all 8-bit Atari computers of any memory size, with disk or cassette.

Sierpinski Curves is the second program published in Antic under our exchange agreement with Page 6, England's leading Atari magazine. (See Graphics Impossible, October 1987). Allan Sharpe of the Brighton Users Group sent this short, flashy demonstration of fractal mathematics to Page 6, where it appeared in the May/June 1987 issue.

"Fractals imitate nature," explained Charles Jackson in Fractals for Your Atari (Antic, April 1986). Fractal curves are "infinitely squiggly." They are used for studying shapes of natural formations such as snowflakes and honeycombs.

Mathematician Benoit Mandelbrot claims that Gustave Eiffel used formulas similar to the "Sierpinski Arrowhead" to design the Eiffel Tower. To check this out, type in Listing 1, CURVE.BAS, check it with TYPO II and SAVE a copy before you RUN it.

This impressive display of Sierpinski's curves follows a very simple "search-and-replace" rule:

1 We start with a shape that looks like this:

Curve 1

2. Search for all shapes that look like this:

Curve 2

3. Replace each one with a shape that looks like this:

Curve 3

4. Return to Step 2 and apply our "search-and-replace" rule to all the new angles we just formed.

What you end up with is a fascinating color display in Graphics 7+16. The previously mentioned Antic article Fractals for Your Atari (April 1986) provides a detailed explanation of how to adjust mathematical formulas in your programs to obtain different visual effects.

Listing 1: SIERPIN.BAS Download