Code Monkey home page Code Monkey logo

mandelbrot's Introduction

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

mandelbrot's People

Contributors

yakaras avatar

Stargazers

 avatar III avatar Peter Biber avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.