COSC 231 WINTER 2014 PP#5 Fractals in Javascript Distributed 3/13/2014 Due: 4/3/2014 (2-1/2 weeks) Write Javascript, HTML and CSS to display three fractals. ---> You MAY use HTML5 canvas if you want <--- A fractal is an interesting mathematical construct that has a surprisingly wide set of applications. This project introduces you to the generation of fractals, using either a recursively defined or an iteratively defined method. The top page for this project will let the user choose one of three fractals. When the user chooses a fractal, a new page will open with a form for user specified parameters. When the user clicks a "draw it" button, you will generate (draw) the fractal on that page. Do not erase the form contained the parameters. The user must be able to change parameters and cause a new drawing to appear on that page. (1) Fractal I -- Koch snowflake (super easy) User parameters: number of edges: 3, 4 (i.e., starting shape: triangle (3 edges) or square (4 edges)) background color: 4 choices (light) foreground color: 3 choices (dark) size: length of bounding square side (the fractal will fit within the (undrawn) square. (2) Fractal II -- dragon curve (medium) User parameters: background color: 4 choices (light) foreground color: 3 choices (dark) size: length of bounding box box (the fractal will fit within the (undrawn) square. (3) Fractal III -- a Julia set (easy coding, but intimidating math) Draw any Julia set (see http://en.wikipedia.org/wiki/Julia_set#Quadratic_polynomials) for examples and functions User parameters: background color: 4 choices (light) size: length of bounding box side (the fractal will fit within the (undrawn) square. (4) Extra credit: Design and demo a fractal that might be used as CGI in a game environment: E.g., - city skyline, - mountainous horizon, - star field - grass - texture of a building wall User parameters: as appropriate for your fractal For explanations of fractals, see the following links (under construction). (1) wikipedia.org: http://en.wikipedia.org/wiki/Koch_snowflake http://en.wikipedia.org/wiki/Dragon_curve http://en.wikipedia.org/wiki/Julia_set#Quadratic_polynomials (2) my write-ups (3) other write-ups Turn in: Hard copy of all files Screen shot of all fractals Demo and walk-thru Grade based on: Correctness: 80% Readability of code: 10% (comments, names, use of functions, elegance) User friendliness: 10% (forms work as implied, good placement, good spelling, no jumping around, ...)