jasoc / python-mandelbrot

A simple python script that print the Mandelbrot set for every power of the formal formula.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Mandelbrot

A simple python script that print the Mandelbrot set for every power of the formal formula.

                                                                        **


                                                                            **
                                                                          ****
                                                                      **  ****  **
                                                                        **********
                                                                      ************
                                                                        ********
                                                          ****    **********************      **
                                                          ******************************  **  **
                                                          ************************************
                                                      **  **************************************
                                                    ******************************************
                                                      ******************************************
                                                    **********************************************
                                ****  ******        **********************************************
                                ****************    ********************************************
                                ******************************************************************
                        **    ********************************************************************
                          **********************************************************************
                        **********************************************************************
    **  **  **      ************************************************************************
                        **********************************************************************
                          **********************************************************************
                        **    ********************************************************************
                                ******************************************************************
                                ****************    ********************************************
                                ****  ******        **********************************************
                                                    **********************************************
                                                      ******************************************
                                                    ******************************************
                                                      **  **************************************
                                                          ************************************
                                                          ******************************  **  **
                                                          ****    **********************      **
                                                                        ********
                                                                      ************
                                                                        **********
                                                                      **  ****  **
                                                                          ****
                                                                            **


                                                                        **

If you don't see the set printed, zoom out your terminal.


The standard formula for the set is

However, the script is generalized for every power, so basically can calculate for every N.

If you execute the script as is, it will print the set calculated with N=2, but you can pass as a console argument every N you want.

Example:

mandelbrot.py 4

will print

If you pass the -i or --iterate parameter, it will print print all the power until will reach the passed one. So

mandelbrot.py --iterate 3

will print then and

Install dependencies with pip install -r requirements.txt

And sorry for some dumb math trick inside the code 🐵

About

A simple python script that print the Mandelbrot set for every power of the formal formula.

License:MIT License


Languages

Language:Python 100.0%