Skip to content

Creating Fractals using Chaos Game, written in C++ and SFML

Notifications You must be signed in to change notification settings

abhayMore/Chaos-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Chaos-Game

Creating Fractals using Chaos Game, written in C++ and SFML

Demo

YouTube : https://youtu.be/8pyCVVWE1LI

Summary

Chaos Game is a method of creating Fractals, using polygons and an intial random point inside it. A random vertex is chosen and the starting/initial point is moved in that direction in some fraction knowns as distance factor(like 1/3, 1/2 etc).
Taking this new position as current and choosing random vertex again and moving towards it depending on the distance factor, doing this iteratively produces a fractal.

This code focuses on n-flake or Sierpinski n-gon theory

This code shows fractals related to n-flake thoery, where n is the number of vertices and if the necessary distance factor is given produces a nice fractal flake.

How to Run (only for Linux)

Install SFML
Install make (command : sudo apt install make )
Run command : make F1=main.cpp

The program expects two inputs

  1. The number of vertices
  2. The distance factor

Output

This is a Sierpinski Triangle, it is an n-flake, where n is 3 and the distance factor is 1/2 or 0.5.

output

About

Creating Fractals using Chaos Game, written in C++ and SFML

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published