I have written two programs to calculate Mandelbrot and Julia-sets in polar coordinates. The first program called pfract calculates the actual iterations into a special file (see specs), and the other program is then used for colorizing the results to get a PPM-image. This can be converted to other formats by PBMPLUS-library. These programs really are quite simple and they should compile with minimal effort. Check the macros UINT16 and UINT32 so that they are defined as a 16-bit unsigned integer and a 32-bit unsigned integer on your machine. Check also the macros for float and double versions of the math functions. Both of the programs can be compiled by using double precision arithmetics (default) or single precision floating point arithmetics by defining NODOUBLE -flag. The pfract program can be compiled either for 16-bit integers (default) or 32-bit integers (by BIG_ITERATIONS -flag). The colorize program can read both of these 16- and 32-bit files. Below are the explanations of these programs and their command-line options. Take a look at some examples too. PFRACTThis program does the actual calculation of the fractals. It's output is a raw-file where the iterations are stored. The coordinate system is such that the angular component goes to the y-axis, and the radius goes to the x-axis of the resulting image. In addition, the x-axis (radius) is normalized with exp-function so that angles are preserved in this mapping. Here is the list of available options:> pfract -h ------------------------------------------------------------ | Mandelbrot- and Julia-set fractals in polar coordinates. | | (C) Mika Seppa 1996 (email: my.email.address) | ------------------------------------------------------------ Usage: pfract [options] [outfile.raw] -cx ... : Start-point x-coordinate (0) -cy ... : Start-point y-coordinate (0) -help : This help -iterations ... : Maximum iterations (255) -julia : Calculate Julia-set -rad ... : Minimum radius (-5) -size ... ... : Size of the image (256x256) -x ... : Origin x-coordinate (0) -y ... : Origin y-coordinate (0)
HOWTOCOLORIZEThis program reads the raw-output from the pfract program and colorizes it into a PPM-file. With the help of options shown below, one has a simple control over the colorizing process.> colorize -h ------------------------------------------------------------ | Iteration file colorizer | | (C) Mika Seppa 1996 (email: my.email.address) | ------------------------------------------------------------ Usage: colorize [options] [infile.raw] [outfile.ppm] -fadeout ... : Fades out to white (0) -fadedepth ... : Depth of fading (20) -help : This help -info : Show information about file -inset .. .. .. : Color in the set (0,0,0) -scale ... : Color scale (1) -spawn ... : Color angle to spawn (360) -start ... : Starting color angle (0) -- : Use stdin instead of file
HOWTO |