Creates images of the Mandelbrot set
This node.js package calculates and visualizes the mandelbrot set. The computation
is performed by the provided mandelbrot.js script, and the visualization is done
in python by a mandelbrot-plotter script.
Clone this repository by running:
$ git clone https://github.com/raymenzel/mandelbrot.git
$ cd mandelbrot
Inside the base of this repository run:
$ npm install
$ python3 -m venv env
$ source env/bin/activate # if in bash
$ pip install --upgrade pip
$ pip install ./visualize
The node.js script has the following command line interface:
$ node mandelbrot.js --help
Usage: mandelbrot [options]
Options:
-x, --center-x <x> x-coordinate of the center of the view (default: 0.). (default: 0)
-y, --center-y <y> y-coordinate of the center of the view (default: 0.). (default: 0)
-w, --width <w> width of the view (default: 5). (default: 5)
-h, --height <h> height of the view (default: 5). (default: 5)
-s, --step <s> resolution of the view (size of a pixel scaled to view size; default:
0.01). (default: 0.01)
-n, --max-iterations <n> maximum number of iterations to perform at each pixel (default: 100).
(default: 100)
-b, --bound <b> divergence cutoff. If the abs(z) >= bound, the iteration stops
(default: 2). (default: 2)
-p, --power <p> exponent used in the mandelbrot equation (default: 2). (default: 2)
--help display help for command
Similarly, the documentation for included python visualizer can be found here.
Three examples of how to run these scripts together are provided in example.bash. They can be generated by running
$ bash example.bash
to produce images like these:


