Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 2.27 KB

README.md

File metadata and controls

36 lines (28 loc) · 2.27 KB

Scripts to generate the Mandelbrot set and Julia Sets

A Brief Note

The script mandelbrot.py can be called from the command line, but parameters are passed in an if __name__=="__main__" statement at the bottom of the script. I would implement a command line argument parser (and argparse would be the way to do it) but I think the amount of effort required is greater than the reward.

The arguments for the primary function in the script are described below. The secondary function, print_progress_bar, simply prints a progress bar, very much like what pip uses. I borrowed this script from here.

Parameters

These are also described within each file.
  • a: number between -2 and 2
  • b: number between -2 and 2 Above are only used in julia.py
  • initial_color_hue: number between 0 and 1. Specifies the initial coloring based on HSV color model. Corresponds with Hue.
  • color_scale: how rapidly colors change while rendering the fractal Above are for use in a color smoothing algorithm. More info here
  • zoom_level: any number from 1 to inf.
  • center_point: point at which the image is centered. Bounded by ((-2, -2), (2, 2))
  • max_iter: number of iterations to run on a pixel
  • job: helpful for when generating multiple fractals. First number that shows up in the image name.
  • directory: directory to save image in. Must be relative to current working directory.
  • image_size: Image size in pixels (tuple)
  • image_save: whether or not to save the image (boolean)
  • x_max: Maximum value on the real axis on which the fractal is defined. Highly recommended that this number (2.3) is not changed.
  • aspect_ratio: ratio between sides of image
  • verbose: print information about generation of image (boolean)

If you have any questions, please let me know.

Examples of images

A Julia Set: Julia Set

A Mandelbrot Set: Mandelbrot Set