Giter VIP home page Giter VIP logo

dragon_curve_fractal's Introduction

forthebadge made-with-python ForTheBadge built-with-love

Dragon Curve Fractal

Fractals have always fascinated me, no matter which shape or size they come in, no matter what patterns they resemble within them. For the ones who are still in the dark, fractals are just a self replication of a particular pattern.

There are many fractals that are found in nature. One such fractal curve is known as Heighway Dragon, or simply the Dragon Curve. Because this is a fractal, hence it requires an IFS (Iterated Function System). In simple words, we make a simple pattern, put it into a recursive function, before running a loop and calling the function over and over again until our objective is accomplished. This is the route that I took. Of course this can be done without recursion(using loops) which I will put as the other solution.

I used Python with Turtle package for both the methods, which simplifies my work down by a ton. Had I done it in C++, I would have had to write functions, and classes for drawing, painting, iterating and putting everything into a window. However, I do have plans for that, and if I can come up with a nice and easy working C++ code, I will put it up here. For now, let’s get cracking with Python.

P.S. The logic behind the code can be found in the documentation folder of this repository.

Results

Dragon Curve Fractal using Recursion

Dragon Curve Fractal (olive green colour)

Dragon Curve Fractal (green)

Dragon Curve Fractal using Loops

Dragon Curve Fractal (loops)

Languages used :

  • Python
    • Turtle Module

dragon_curve_fractal's People

Contributors

aditya-ramachandran 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.