-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
35 lines (28 loc) · 1.64 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ChaosGame.java is a simulation of a particular chaos game that results in
an approximation of a sierpinski gasket
(http://en.wikipedia.org/wiki/Sierpinski_triangle). A Sierpinski Gasket is
a fractal that is infinitely self-similar.
I was acquainted with the gasket in Ian Stewarts book "The Magical Maze"
in which he describes chaos theory very briefly and uses this Chaos Game
as a means to show how chaos or random actions can result in suprisingly
meaningful and predictable results.
The following are the rules by which the game is set up and played:
1. Draw an equilateral triangle
2. Assign each vertex of the triangle a value (e.g. 1,2,3 or a,b,c)
3. Choose and mark a randomly selected point within the triangle as a
start position.
4. using a three sided die (or something that has equal probablity of
landing on one of three sides) assign each "side" to one vertex
of the triangle.
5. roll the die, from the previously drawn point draw a new point half way
between the point and the vertex that the die indicates.
6. repeat step 5 ad infinitum or until you feel like stopping.
7. note the "ordered" structure of the points that resulted.
Naturally it would take a significant amount of time to perform this game by
hand and thus I wrote this program to simulate it. With this program
you can either choose to watch each turn played out or simply see the end result.
For a sample you can look at ChaosGame_sample_output.png in this repository,
although I would suggest running the program for a more eye opening experience!
Enjoy!
and if you have any questions, comments, or bugs to report feel free to e-mail me at:
legit [at] alephcipher [dot] com