Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
/ Chaos-Game Public archive

A simple Java gui app that creates fractals applying specifics rules to random generated points

License

Notifications You must be signed in to change notification settings

akanok/Chaos-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaos-Game

A simple Java gui app that creates fractals applying specifics rules to random generated points.

For more information abaout chaos game and fractal visit the Algorithm Archive, the Wikipedia page or the Wolfram one.

Table of contents

About The Project

Chaos game is a method to create fractals using an initial point selected at random inside a polygon and then applying a rule to find the next point. After some iterations we will often (depending on the rule) start seeing the shape.

This project aim is to create a gui that allows to simple generate fractal using the above method.

The main window allows to select from three polygons (Triangle, Squere, Pentagon) or to create yours (Custom) by choosing the number of sides (wich obviously must be greater then three) and to insert the number of iterations.

You can also select two different rules to generate the points: both of them starts from a random point inside the shape, select a vertex of the polygon and then choose the mid point of the distance between the previous point and the vertex as the new point form wich reiterate this algoritm.
In the first rule (the default one for the triangle) the vertex is choosen randomly, while in the second one (the default for other shapes) is added one condition: it must be different from the previous one.



Main window with default settings for Triangle

Main window: Default settings

Trinagle fractal (also known as Sierpiński triangle)

Shape window: Trinagle

Square fractal

Shape window: Square

Pentagon fractal

Shape window: Pentagon


Main window with custom settings for Esagon

Main window: Custom settings

Esagon fractal

Shape window: Esagon



Getting Started

Prerequisites

This project requires:

  • Java 11 or newer

Quick start

To run this project from the commnad line (on Unix systems) follw this steps:

  1. Clone the reposiory:
    git clone [email protected]:akanok/Chaos-Game.git or git clone https://github.com/akanok/Chaos-Game.git
  2. Move into the project folder: cd Chaos-Game/
  3. Create bin folder for .class files: mkdir bin
  4. Compile java files: javac -sourcepath src/ -d bin/ src/chaos/game/*.java
  5. Move into the bin folder: cd bin/
  6. Run the app: java chaos.game.Main

If you prefere you can also create a .jar and execute it:

  1. Steps 1 to 5 are identically as before
  2. Create .jar archive: jar cvfe MyApp.jar chaos/game/Main chaos/game/*
  3. Run the app: java -jar MyApp.jar

Built With

License

This project is licensed under MIT.
Please see the LICENSE file for details.

About

A simple Java gui app that creates fractals applying specifics rules to random generated points

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages