Thanks to visit codestin.com
Credit goes to github.com

Skip to content

yakaras/mandelbrot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues


mandelbrot.py

A script to display the Mandelbrot set with python

About The Project

Product Name Screen Shot

The mandelbrot function takes in a real and imaginary part of a complex number c, as well as a maximum number of iterations to perform. It then iteratively computes the sequence $z_{n+1} = z_{n}^2 + c$, where $z_0 = 0$, until either the sequence diverges (i.e., $|z_n|$ exceeds $2$) or the maximum number of iterations is reached. It returns the number of iterations before the sequence diverges, or the maximum number of iterations if the sequence does not diverge.

The main code sets the size of the image (columns and rows) and creates an array result to store the iteration counts for each point in the complex plane. It then loops over each point in the plane, calls the mandelbrot function to compute the iteration count for that point, and stores the result in the result array. Finally, it generates an image of the result array using the imshow function from matplotlib.

Run

  1. Clone the repo
    git clone https://github.com/iion91/mandelbrot.git
    or download the file
  2. Install dependencies
    pip install numba
    pip install numpy
    pip install matplotlib
  3. Start the script
    python mandelbrot.py

About

Python script to display the mandelbrot set

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages