Giter Club home page Giter Club logo

juliaset's Introduction

Julia set

This repository contains a single Python script to create nice images or animations of Julia sets.

This script has a command line interface: get started with the following command:

python JuliaSet.py --help
usage: JuliaSet.py [-h] [-k [K [K ...]]] [-s SIZE] [-x X] [-c COLORMAP]
                [--pattern PATTERN] [-o OUTPUT] [-n NUMBER] [-p]

Generate a julias set fractal curve

optional arguments:
-h, --help            show this help message and exit
-k [K [K ...]]        complex number used to create Julia set. Two numbers
                        have to be given for animation. Default is
                        0.285+0.01j. (default: [(0.285+0.01j)])
-s SIZE, --size SIZE  size of the generated image. (default: 401)
-x X                  domain size of the fractal. Default is 2.0, meaning a
                        -2 x +2, -2 x +2 square will be created. (default:
                        2.0)
-c COLORMAP, --colormap COLORMAP
                        name of the matplotlib colormap to use. (default:
                        autumn)
--pattern PATTERN     pattern use to control output. A letter corresponds to
                        a picture, several letters can be given. Description
                        is given below. (default: abcde)
-o OUTPUT, --output OUTPUT
                        name of the generated file. If not provided, result
                        will display on screen. (default: None)
-n NUMBER, --number NUMBER
                        number of pictures to generate between two complex
                        numbers. Default is 2. (default: 2)
-p, --parallel        boolean used to create images in a parallel way. It
                        used the (n-1) cores. Default is False. (default:
                        False)

# Display help
python JuliaSet.py --help

# Create a Julia set fractal with k=0.285+0.01j with 501 points and a square with half-length of 1.25
python JuliaSet.py -s 501 -x 1.25 -k 0.285+0.01j

# Create an animation with 50 frames that covers from 0.285+0.01j to 0.285+0.02j
python JuliaSet.py -s 501 -x 1.25 -k 0.285+0.01j 0.285+0.02j -n 50 -o animation.mp4

# Same as previous but with fully developped argument and parallel execution
python JuliaSet.py --size 501 -x 1.25 -k 0.285+0.01j 0.285+0.02j -number 50 --parallel

# Pattern describes the output displayed. Possible letter are:
a : Real part of Z
b : Norm of Z
c : Imaginary part of Z
d : Convergence level
e : Ponderation between norm and convergence level

# Available colormaps are
Accent, Blues, BrBG, BuGn, BuPu, CMRmap, Dark2, GnBu, Greens, Greys, OrRd, Oranges,
PRGn, Paired, Pastel1, Pastel2, PiYG, PuBu, PuBuGn, PuOr, PuRd, Purples, RdBu, RdGy,
RdPu, RdYlBu, RdYlGn, Reds, Set1, Set2, Set3, Spectral, YlGn, YlGnBu, YlOrBr, YlOrRd,
afmhot, autumn, binary, bone, brg, bwr, cool, coolwarm, copper, cubehelix, flag,
gist_earth, gist_gray, gist_heat, gist_ncar, gist_rainbow, gist_stern, gist_yarg,
gnuplot, gnuplot2, gray, hot, hsv, jet, nipy_spectral, ocean, pink, prism, rainbow,
seismic, spectral, spring, summer, terrain, winter

juliaset's People

Contributors

gjacquenot avatar

Watchers

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