Skip to content

BLARGoMATIC/MathGraphics

Repository files navigation

https://en.wikipedia.org/wiki/Chaos_game

Rules

  1. Take a given shape (Just regular polygons in this case).
  2. Plot a Random point
  3. Pick a random vertex (Following chosen restrictions)
  4. Go halfway to that vertex and plot a point
  5. Repeat steps 3-4 1000000 times
  6. Get pretty fractal

Build Dependencies

Jackson https://github.com/FasterXML/jackson (used for preset saving/loading).

Maven pom.xml is included, you can just use that.

Vertex Restrictions

No Prefence - Pure random
Equivalence - must be or must not be equal to the last chosen vertex (v-1) and/or the vertex before last (v-2)
Adjacency - must be or must not be adjacent to (v-1) and/or (v-2)
Offset - Similar to Adjacency but a custom number of 'hops' over instead of just 1

Some Results

Sierpinski Triangle

Sierpinski Triangle
Red -> Orange -> Yellow, 10000000 iterations

Pentagon Faces

Pentagon Faces
Red -> Orange -> Yellow, 10000000 iterations

Heptagonal Star

Heptagonal Star
Red -> Orange -> Yellow, 10000000 iterations

9-gon Biohazard

9-gon Biohazard
Green -> Cyan -> White, 10000000 iterations

Snowflake

Snowflake
White -> Cyan -> Blue, 10000000 iterations

Unnamed Chaos Square

Chaos Square
Red -> Orange -> Yellow, ~15000000 iterations

Hexagonal Twisted Star

Hexagonal Twisted Star
Red -> Orange -> Yellow, 15000000 iterations

and many more...

I'm interested in making this in geogebra, so it's much more shareable. However implementing the vertex restrictions seems difficult as it's mostly a calculator not a programing language.

About

Fiddling with the chaos game.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages