Coder Social home page Coder Social logo

beauty-of-fractals's Introduction

beauty-of-fractals

This is a Python3 program to understand and evaluate the structural beauty of the Mandelbrots set and Julia sets.

Requirements

This implementations is mainly based on matplotlib and geopandas. You can install all the required environment through:

pip install -r requirements.txt

Addtionally, ArcGIS desktop 10.4 (and Axwoman 6.3 if possible http://livablecitylab.hkust-gz.edu.cn/binjiang/axwoman/) is required for visualizing the inherent hierarchy of these fractals.

Painting the Mandelbrots set and the Julia sets

  1. Open Python script s3_trajectory.py and set the value c_pre in line 6 for the complex number c to draw different Julia sets . The trajectory of sequence {zn} for the Mandelbrot set will be displayed on the left side while the Julia set on the right side.

  2. Run the Python script in your IDE or run command:

    python s3_trajectory.py
  3. Click and drag a point from any location to another space within the left complex plane. If the current point belongs to the Mandelbrot set—in other words, if the corresponding sequence remains bounded within the threshold circle—it will be marked as a black point on the visualization. Here is an illustration of the user interface: MSJS

Generating binary images

  1. Open Python script s3_binary.py and adjust different sizes of the images where you can see MS and JS at different resolutions. The related parameters are from line 12 to lin 16.

  2. Run the Python script in your IDE or run command:

    python s3_binary.py
  3. Click and drag a point (in red) from any location to another space within the complex plane of MS. Each point corresponds to a different JS. Click save button to save the current image of JS such as 1-0.10_0.79.png1 under the root folder. The current images of the Mandelbrot set will be saved automatically as ms_%max_iter%.png. trajectory

Identifying substructures

  1. Open s4_beauty.py and change the parameters of input_path and output_path where there are the input Mandelbrot set polygon shapefile and output contour line shapefile of the identified bends. We have already provided a sample contour in sample_data/contour16.shp.

  2. Run the Python script in your IDE or run command:

    python s4_bends.py
  3. The substructures, which are the bends defined by three vertices, will be autormatically indentified and saved as bends16.shp. Please follow the Tutorial4MSJS.docx for more details on calculating the degree of substral beauty.

Results

  • Comparison between the Mandelbrot set after 4 iterations and 16 iterations results

beauty-of-fractals's People

Contributors

andy-jingqian-xue avatar

Stargazers

 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.