Code Monkey home page Code Monkey logo

fractal_generation's Introduction

fractal_generation

Dragon Curve

This is the shape generated by a thin strip of paper if you were to fold it in half repeatedly, and then unfold all of your folds to 90 degree angles. My inspiration to pursue this project came when I was playing with a straw wrapper at a restaurant.

Alt text

This fractal was generated using Python Turtle graphics as the framework. Essentially, I recursively generate a string of left and right turns which commands a line-drawing agent to trace out the entire fractal. I created the color gradient by fine-tuning the frequency and phase of some fancy sinusoidal functions for the RGB values.

Mandelbrot Set

A classic example of the beauty of mathematics. This fractal was generated by starting with a complex number c between -2 - 2i and 2 + 2i. This complex number is then plugged into the recurrence relation: , where z is the previous output (initialized to 0), and c is the point we are evaluating. A point is in the Mandelbrot set if z does not explode to infinity (diverge) within a given number of iterations (recursion depth).

This recursive relationship is evaluated for every point in the image (except for some of the central bulbs, which I check for analytically to save computation time). Each point is colored by the highest depth at which it continues to be in the Mandelbrot set.

Alt text

When running mandelbrot.py, simply drag your mouse across the screen to make a zoom window and generate a new plot! The depth and resolution are completely configurable.

fractal_generation's People

Contributors

jeremy-collins avatar

Stargazers

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