

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A programming project for creating a graphical user interface (gui) to display the sierpinski triangle and mandelbrot set with user-controlled parameters. The project involves writing code to generate these fractals using given algorithms and creating a gui with buttons for clearing the drawing surface, generating the fractals, adjusting the speed, and selecting colors. The document also includes explanations of the sierpinski triangle and mandelbrot set, their generation algorithms, and how to represent points in the complex plane.
Typology: Study Guides, Projects, Research
1 / 3
This page cannot be seen from the preview
Don't miss anything!
COSC 231 Programming Project GUI for Two Fractals Distributed : 24 November 2009 Due : 10 December 2009 Write a GUI that will display, with certain user-controlled parameters, the Sierpinski gasket and a Mandelbrot set. Sierpinski triangle (gasket) The Sierpinski triangle generation algorithm is given in Savitch’s book (3rd^ edition) on pp 1061 - 2. That text is reproduced here. Write a program that draws a Sierpinski gasket. A Sierpinski gasket or triangle is a type of fractal. It is an example of how an orderly structure can be created as a result of random, chaotic behavior. The creation of a Sierpinski gasket is fairly simple. There are three points that form the corners of a triangle. In the figure below, they are labeled as A, B, and C. To draw the Sierpinski gasket follow the algorithm:
repeating structure: < picture from Savitch is not reproduced here. Look at http://en.wikipedia.org/wiki/Sierpinski_gasket > To draw a single pixel at coordinate (x, y) use the drawline method where the start and endpoints are both (x, y). To generate a random number x , where 0 < x < 1 , use x = Math.random();. For example, multiplying by 3 and converting to an integer results in an integer that is from 0 to 2. Mandolbrot set There are several explanations of the Mandelbrot set. A simple one, including the iterative algorithm for determining if a number is a member of the set, is given at
Here is another simple explanation:
Each point, C, in the complex plane is a member of the Mandelbrot set if after iterating (forever), the magnitude of Z is less than 2. Z iterates as follows: Z 0 = 0. Zn+1 = Zn * Zn + C Represent a point C = x + iy on the drawing surface as (x, y). The GUI Interface The GUI interface will have a drawing surface and the following buttons: