mandel2.icn: Program to draw the Mandelbrot set

June 17, 1994; Roger Hare
Requires: Version 9 graphics
This file is in the public domain.
This program draws portions of the Mandelbrot set according to the values
input # on the command line. The method is that described in the articles by
Dewdney # in the Computer Recreations column of Scientific American in August
'85, # October '87 and February '89.

I have problems with colours (not enough of 'em!), so I have used alternated
black and white. Those with decent X-terminals will be able to do far
better than me.

The program certainly doesn't display images as striking as those seen
in publications. Perhaps the scaling of the value of k needs to be
different? All suggestions gratefully received.

It is possible to speed things up by displaying the points row by row
rather than randomly, but as the program is resident in the 100 cycle
iteration most of the time, this is only ~5% speed-up. Not really
worth it.

One of Dewdney's articles mentions other methods to speed things up - I
will search out the algorithms one of these days...

Usage is - xmand startr startc size n &

where:

startr, startc are the co-ordinates of the lower left hand corner of the
 area of the complex plane to be displayed
size is the size of the (square) area of the complex plane to be displayed
n is the number of pixels into which size is to be divided for display
 purposes

For example - xmand -1.5 -1.25 2.5 400 &

will display the Mandelbrot set in the 2.5x2.5 region of the complex plane
whose s-w corner is -1.5-i1.25. The display will be 400x400 pixels.

The program has been tested on a Sun 4 using the Icon compiler, and
on a Sequent Symmetry running Version 5 Unix using both the
compiler and translator.

Source code | Program Library Page | Icon Home Page