File Exchange

image thumbnail

The Chaos Game

version (256 KB) by David Garrison
Play the Chaos Game to generate interesting shapes using a semi-random process


Updated 01 Sep 2016

View License

The Chaos Game is a mathematical method used to create a sequence of points iteratively using a simple set of rules. In the Chaos game we start with a random point, use the rules to generate each successive point, then plot the resulting set of points.
Here are the rules of the game:
* Define 3 vertices in the x-y plane that define an equilateral triangle
* Start with a random initial point .
* At each step, select one of the 3 vertices at random
* Determine the next point by moving halfway from the selected vertex to the current point
* Plot the next point

Comments and Ratings (5)

Kfznd Kfznd

Это фрактал

You can open this example using the Live Editor in MATLAB R2016a or higher

tao yang

haoran duan


mlx?how to open?


Updated license

New thumbnail

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags