Thursday, 10 January 2013

PYGAME- “Sierpinski Triangle”

           
             The Sierpinski triangle fractal was first introduced in  1915 by Waclaw Sierpinski , who described some of the triangle’s interesting properties .  The Sierpinski triangle is a geometric pattern formed by connecting the  midpoints of the sides of a triangle. It is at the s most  interesting and  simplest fractal shapes in existence. Because one of  the neatest things about Sierpinski's triangle is how many different and easy  ways there are to generate it . This is one of the basic examples of self-similar  sets, that is  it is a mathematically generated pattern that can be reproducible at any  magnification or reduction.

Construction


  1)  Start with any triangle in a plane. The canonical Sierpinski triangle uses a
       equilateral triangle with a base parallel to the horizontal axis

  2)  Connect the midpoints of each side to form four separate triangles, and  cut
        out the triangle in the center

  3)  Each of the three  remaining triangles, perform this same act








Formation after each iteration
-->

Tuesday, 8 January 2013

PYGAME- “ Koch Snowflake ”


 
-->
             Fractals are one example of "algorithmic art" . Here discussing about a particular kind of fractal known as the Koch Snowflake. A fractal is an image that keeps on repeating itself every new time it gets smaller and smaller. The snowflake is a fractal of the Koch curve. Helge von Koch who is responsible for the snowflake. He wrote about the fractal snowflake in a paper written in 1906. The most interesting part about a Koch snowflake is that when you continue this creating process the curve is infinitely long but has an finite area. This means the the sides of the snowflake are never ending but at the same time the area it encloses is only going to be 1.6 times bigger then the original area of the original triangle. 

-->

Design Steps


Constructing a Koch snowflake is a 
 step by step process.

Step1

Start with an equilateral triangle.

Step2


Split each side into three equal segments.

step3


Create an smaller equilateral triangle in the middle of the three parts from step 2

step4


Remove the line segment that is the base of the triangle from step 3

-->
              If you continue repeating this procedure, the curve will never self-intersect, and in the limit you get a shape known as the Koch snowflake. Each time you repeat the process this is call an iteration. To find the number of sides all you need to know is how many iterations you have completed. 

Saturday, 22 December 2012

PYGAME - "Game of Life"

             The Game of Life is a cellular automation concept by the mathematician John Horton Conway. The system is simple and interesting. It is not like a conventional game, that is there is no players, and no winnings or losing. The game is a zero- player game, meaning that its evolution is determined by its initial state, requiring no further input. Once the "pieces" are placed in the starting position, the rules determine everything that happens later. In this game it is impossible to look at the starting pattern of the game. The pattern randomly changing as per the rules. the only way to find what will happen in the future is the follow the rules of the game

Rules of the Game of Life

               Game of Life is played on an infinite two-dimensional grid of square cells like a chess board. Each of this cell is in one of two possible state live or dead. A Live cell is shone by a square filled with black colour, a Dead cell is shone by a square filled with white colour. every cell interact with eight niborous cells, which are the cells that are horizontal, vertical and diagonally adjacent.
 


The rules determines the next state of each cell according to the current state of the cell and number neighboring live cells. the rules are given below

1) A dead cell with exactly three live neighbors become a live cell(Birth)





2) A live cell with two or three live neighbors stays alive(survival)
     




3) Any live cell with fewer than two live neighbors dies, as if   caused by under population
   



4) Any live cell with more than three live neighbors dies,as if by overcrowding




                The initial pattern constitutes the seed of the system. The first generation iscreated by applying the above rules simultaneously to every cell in the seed,births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a purefunction of the preceding one). The rules continue to be applied repeatedly to create further generations.