Git Product home page Git Product logo

mandelbrot-orbit's Introduction

Build Status

Mandelbrot Orbit

This program generates the orbit for a given Mandelbrot point. Something like:

Orbit of a mandelbrot point

That's the orbit of point (-1.3,0) which has period 4.

Math

This is the Mnadelbrot Set basic formula:

f(z) = z² + c

where z and c are complex number.

The Mandelbrot set is the set of complex numbers c for which the function does not diverge when iterated from z=0. Than means, given a c complex number, if you apply the formula to that number n times using the previous result as the new z number, that c belongs to Mandelbrot Set if the sequence does not diverge.

This python script plots the series for a given complex point.

Prerequisites

Python 3.6.9
pytest-5.3.5

Usage

Install:

./bin/install

Run:

mandelbrot-orbit '{ZX}' '{ZY}' {NUM_ITERATIONS} {OUPUTFILE}
mandelbrot-orbit -0.1 0.7 100 ./mandelbrot_orbit.png

The script generates an image: mandelbrot-orbit.png

Development

Setup:

./bin/dev-setup

Running the tests:

./bin/test

Run:

./bin/run '-0.1' '0.7' 100 ./output/mandelbrot_orbit.png

Troubleshooting

You could see this error:

/home/josecelano/.local/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3.py:195: Warning: Source ID 8 was not found when attempting to remove it
  GLib.source_remove(self._idle_draw_id)

It seems to be a known issue pending to release:

https://stackoverflow.com/questions/29540845/how-can-i-deactivate-warning-source-id-510-was-not-found-when-attempting-to-re

TODO

  • Although calculations are done with an arbitrary precision library, we use matplotlib to generate the graph and that package uses a float type for data source so we cannot plot a point with greater precision than the language float precision.

mandelbrot-orbit's People

Contributors

josecelano avatar

Watchers

 avatar James Cloos avatar  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.