Code Monkey home page Code Monkey logo

fractals's Introduction

Fractals: A multithreaded application that paints fractal patterns

This command-line application generates and visualizes the most popular fractals Mandelbrot set and the Julia set.

Mandelbrot set is defined as the set of complex numbers C such that: Zn+1 = Zn2+C, starting with Z0 = 0 remains bounded when n reaches infinity. (When performing the caculation, instead of infinity the programme takes in an argument for the number of iterations which defaults to 1000) All Mandelbrot numbers are within a region of the complex plane; -1 < real part < 1 and -1 < complex part < 1. We call this the region of interest. These values can be passed to the programme (optional) separated with spaces in the above order. Last argument will be the number of interations.

A point on the display is first mapped onto a point within the region of interest. Once that is done that value is used as C and the above computation Zn+1 = Zn2+C is performed the specified number of iterations and then see if ABS(Zn) > 2 for any n < iterations. If so C is not a Mandelbrot number and therefor assign some colour to it based on value of n when ABS(Zn) > 2. Else assign black. This process is repeated for all points on the canvas.

The Julia set is similar to the Mandelbrot set in that it uses the same equation, but Z0 is the point in the complex plane corresponding to the pixel and C is a constant. Real and imaginary parts of C can be passed (optional) as aguments to the programme separated with spaves, by default its value will be -0.4 + 0.6i.

To install llocally:

git clone https://github.com/KavinduJayas/fractals.git

cd fractals

javac Fractal.java

java Fractal [ Mandelbrot | Julia ] [args]

Class diagram of the Java implementation:

class diagram

fractals's People

Contributors

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