Arun Waves

November 26, 2011

Sierpinski triangle

Filed under: code,Processing,sketch — Arun @ 12:21 am
Tags: , ,

Note: It would help to know a little bit about fractals to appreciate this post.

Ever wanted to create a fractal? For those who are not aware of fractals think of it as a special figure that retains its form no matter how much zoomed in you are, a property known as self-similarity. Don’t believe me, check out this and this.

Quite mind boggling in itself, now if someone told you that this can be generated by a random algorithm!! I had to check it out for myself, so I used the familiar and easy to use Processing programming language to test it. You can read about the algorithm here, it basically involves a moving point whose direction is determined by rolling a dice. The point moves half distance towards one of the three vertices of a triangle When the dice has been rolled a sufficient number of times, you can see the Sierpinski Triangle. In this case the main triangle can be broken into 3 triangles which look like the original triangle and sub-triangle can be broken into 3 more similar triangles. See for yourself ……………..

Here are some screen shots;


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: