Engineering Math - Chaos Theory

 

 

 

 

Sierpinski triangle

 

In this structure, you would notice that a Triangle that has removed the part with the shape of an inverted and scaled-down copy of itself at the center of itself.

Don't worry if you don't understand this explanation. It is hard to explain this only in words. Let me try to explain this in step by step illustration.

 

Simpliy put, if you iterate the following steps over and over with a triangular paper and scissors, you would have the shape as shown in the plot at the end of this page.

 

 

Instead of using paper and scissors, you can draw the same shape in mathematical way as illustrated below. If you iterate the following steps over and over, and mark all the position that you have gone through, you will get the shape shown at the end of the page.

 

 

This is the image (a fractal shape) that can be obtained from the iteration of the procedure illustrated above.

Following is the Octave/Matlab code that implements the procedure explained above and produce the above image.

    v = [0,0;0.5,0.7;1,0];

    Nv = 20000;

    x1 = 0.0;

    y1 = 0.5;

     

    vList = [x1,y1];

     

    for i = 1:Nv

        vidx = randi([1 3]);

        vsel = v(vidx,:);

        x2 = vsel(1);

        y2 = vsel(2);

        x = (x2+x1)/2.0;

        y = (y2+y1)/2.0;

        vList = [vList;x y];

        x1 = x;

        y1 = y;

    end;

     

    plot(vList(:,1),vList(:,2),'bo','MarkerSize',1);

 

If you change the shape of the first triable by changing the vertices of the triangle and repeat the same procedure explained above, you would get the fractal image as shown below.