create account

A: Why does the chaos game generate fractals? by mactro

View this thread on: hive.blogpeakd.comecency.com
· @mactro ·
$0.02
A: Why does the chaos game generate fractals?
## Why does the chaos game generate fractals?
My answer fill focus on Sierpiński triangle case, but I think some general conclusions can be drawn from it as well. By no means I'm an expert in the subject, so there will be no mathematical proofs.

## Rules of chaos game
The rules of the chaos game (as written by @irelandscape), are very simple:

1. Imagine an area of the screen corresponding to a polygon, such as a triangle, square, pentagon, etc.
2. Select a fraction number f between 0 and 1 (e.g 1/2).
3. Pick a random point within that polygon and plot a pixel at that location
4. Select any vertex (corner) of the polygon at random.
5. Calculate the distance d between the last plotted pixel and the selected vertex.
6. Plot a pixel on the imaginary line between the last plotted pixel and the selected vertex at a distance fd from the previously plotted pixel.
7. Repeat from step 4.

Below, I will assume `f=0.5`

## Restricted regions
First let's consider we have already chosen a vertex of triangle.![starting area](
https://i.imgsafe.org/8d/8dcd738042.png
)

Let it be vertex C on the image above. Now if we pick completely random point, anywhere in the triangle, where would next point need to be drawn?
![first triangle](https://i.imgsafe.org/96/963736eea6.png)

In an area marked with yellow. That's because whatever point we choose, we must cut it's distance in half. So for the farthest points located at the line between A and B vertices, resulting points will land on the line between D and E. The closer we get to C with initial point, the closer will be the resulting one.

Now let's see what happens if we mark achievable regions for all vertices:
![all vertices](https://i.imgsafe.org/96/964277742a.png)

You can clearly see what I call a "restricted region" - an area that will be occupied only by a first, completely random point. Points drawn in all subsequent iterations will have to be located in the areas marked with yellow.

 Now, if you think about it, you will notice that to get to some regions of the areas that are currently yellow, you would need to start in the restricted area. So those points will also be restricted.
![restricted areas](https://i.imgsafe.org/96/9642a5c1e1.png)

This of course scales down for as long as you wish. Now, why do only certain values of _f_ generate such a nice fractals? In case of triangle it works well for values bigger then 0.5, which result in the same pattern but spaced apart. For smaller values, triangles start to overlap until empty regions vanish completely, and you get only chaos.

For shapes other then triangle, I think a general rule will be similar: You need to have a set of points that is not achievable in the first iteration. Shape of that area will be replicated over the whole polygon.

**StemQ Notice:** *This post was originally submitted on [StemQ.io](http://www.stemq.io), a Q&A application for STEM subjects powered by the Steem blockchain.*
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 39 others
properties (23)
authormactro
permlinka-why-does-the-chaos-game-generate-fractals
categorystemq
json_metadata{"tags":["stemq","Geometry","fractals"],"app":"StemQ/0.1.2"}
created2018-12-06 18:48:27
last_update2018-12-06 18:48:27
depth0
children2
last_payout2018-12-13 18:48:27
cashout_time1969-12-31 23:59:59
total_payout_value0.023 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,941
author_reputation865,272,238,829
root_title"A: Why does the chaos game generate fractals?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id76,462,448
net_rshares51,806,169,826
author_curate_reward""
vote details (103)
@partiko ·
Thank you so much for sharing this amazing post with us!

Have you heard about Partiko? It’s a really convenient mobile app for Steem! With Partiko, you can easily see what’s going on in the Steem community, make posts and comments (no beneficiary cut forever!), and always stayed connected with your followers via push notification!

Partiko also rewards you with Partiko Points (3000 Partiko Point bonus when you first use it!), and Partiko Points can be converted into Steem tokens. You can earn Partiko Points easily by making posts and comments using Partiko.

We also noticed that your Steem Power is low. We will be very happy to delegate 15 Steem Power to you once you have made a post using Partiko! With more Steem Power, you can make more posts and comments, and earn more rewards!

If that all sounds interesting, you can: 

- Download Partiko Android at [Google Play](http://bit.ly/2SRFIta)
- Or Download Partiko iOS on the [App Store](https://apple.co/2PcXkSd)

Thank you so much for reading this message!
properties (22)
authorpartiko
permlinkpartiko-re-mactro-a-why-does-the-chaos-game-generate-fractals-20190118t114112328z
categorystemq
json_metadata{"app":"partiko"}
created2019-01-18 11:41:12
last_update2019-01-18 11:41:12
depth1
children0
last_payout2019-01-25 11:41:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,019
author_reputation39,207,160,334,751
root_title"A: Why does the chaos game generate fractals?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,553,224
net_rshares0
@steemitboard ·
Congratulations @mactro! You received a personal award!

<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@mactro/birthday2.png</td><td>Happy Birthday! - You are on the Steem blockchain for 2 years!</td></tr></table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@mactro) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=mactro)_</sub>


###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-mactro-20191116t170815000z
categorystemq
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-11-16 17:08:15
last_update2019-11-16 17:08:15
depth1
children0
last_payout2019-11-23 17:08:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length612
author_reputation38,975,615,169,260
root_title"A: Why does the chaos game generate fractals?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,558,329
net_rshares0