Tristan Knoth and Corey Alt CSC 151-01 Professor Weinman 4/23/14 Design Statement:                 This project will focus on using color and lines in order to explore the ideas of depth and motion. Our image will be superimposed upon a blended background image, with the color shifting from the top left corner to the bottom right corner. This blend will in itself provide a sense of motion to the piece, and it will also provide a backdrop with which we can further add motion and depth. In most parts of the image, the background will either be a warm or cool color. The color of the dragon curve will vary from warm to cool, creating a sense of either depth or unity, depending on the background color there. Similarly, placing a cool colored dragon curve on a warm background will create a sense of depth and negative space. In some cases, the dragon curve will be the same temperature as the background. This will actually help to unify the image, and it will explore how color similarities affect the apparent depth of the image. The polygons placed around the bottom right portion of the drawing will always be a lighter, less saturated version of the background color. This will help distinguish the two colors, and explore color context. It should also not draw attention from the dragon curve, the focal point of the image.                 Lines are integral to creating a sense of motion in the image. The dragon curve will be the most notable example of the use of line. The line changes color as it progresses through the curve, helping to illustrate movement from the line's starting point to its ending point. Similarly, viewing different images as a collection will be particularly compelling, as the viewer will then be able to see how an apparently random path organizes into a fascinating, perfectly organized dragon curve.  The other line in our drawing will be the polygons in the bottom right section. They will be organized along a hyperbolic curve, and decreasing in size along its asymptotes. This should help frame the dragon curve, and generate a sense of motion along the line of polygons. Changing the sizes of the polygons will also create a very specific rhythm, and again add to the feeling of motion.   Technique statement:                 Our main procedure, (draw -picture n width height) will call upon three different procedures in order to generate the final image. The first procedure, compute-background, will generate a background image for the rest of the procedures to work on. The second procedure, draw-hyperbola!, will arrange seven polygons along a hyperbola. The last procedure, dragon-curve!, will draw a dragon curve on top of the image. In order to generate 1000 distinct images, draw-picture will extract each of the three digits of n (the main parameter for draw-picture) and assign each one to a different variable. We will then pass each of these variables, with possible values 0-9, to one of the three sub-procedures. This gives us 10^3 unique images.                 The first procedure, compute-background, takes width, height, and n as parameters. It then uses image-compute to create an image with an appealing color blend. Width and height are used, as one would expect, to assign the width and height of the image. N is used to compute each of the three components of the irgb color at each pixel. For the red component, if n < 4, the red component increases horizontally. If n >=  7, the red component decreases from top to bottom. Otherwise, the red component is 0. This part is integral in establishing color temperature across the image. For the green component, if n < 7, the component decreases from left to right. Otherwise, it's zero. For the blue component, if n >= 4, the value increases from top to bottom. Thus, there is an intersection where when n >= 4 and n <  7, the green and blue components are maximized and the red component is minimized. Thus, the colors are very cool in this situation. Similarly, certain values of n maximize the redness of parts of the image. All three components contain appropriate coefficients such that different values of n look distinct.                 The second procedure, draw-hyperbola!, is intended to arrange seven polygons, evenly spaced along a hyperbola with asymptotes on the right and bottom edges. We found that it was easiest to implement this procedure in a somewhat specific form, by extracting seven points on the graph of y = (1 / x). Because of the nature of a hyperbola, one cannot simply iterate through different x-values and get evenly spaced points. Therefore, we converted everything to polar coordinates in order to find evenly spaced points. From there, it is a simple matter to essentially treat this arrangement as a fixed set of images, and then just scale the horizontal and vertical placement to match however long each side of the image is. We simply locally bind the x and y coordinates to transform the curve to lie in the bottom right corner, and scale the x and y coordinates so that for any image height and width, each point will always lie the same relative distance along the axis. While we explored some more general algorithms for finding equidistant points on a hyperbola, such as parameterizing everything, or iterating through a polar curve, this method offers unparalleled simplicity and scalability. Once we have established the center of any given polygon, we used the procedure turtle-centered-polygon! to draw the shape. Size is determined from the x and y coordinates, which vary inversely from each other, and we can thus build a simple piecewise function for size, where the maximum radius always lies at the middle polygon. This procedure, inspired by one from assignment 7, has the added feature of using cons to attach each vertex of the polygon to a list of vertices. Then, we can use image-select-polygon! to select and color the enclosed region. We chose to fill each polygon with a lighter version of the background color at that point. The turtle can also tell us the background color at any given point, and we used irgb-lighter to transform said color.                 The final procedure, dragon-curve!, draws the famous fractal. The procedure sends a turtle along the path, changing color as it goes. The path of the dragon curve is best defined recursively, and it is called to recur (n + 2) times. The base case simply draws a straight line between two points. However, for each higher level, the algorithm replaces each straight segment with two lines at a right angle to each other. Then, each pair of lines is rotated 45 degrees alternatingly to the right or to the left. We implemented this feature by adding two extra parameters, turn1 and turn2. For the first call, for example, turn1 = 1 and turn2 = -1. Then the two values switch for the next call. These values are used as coefficients for the 45 degree turn and thus the turn directions alternate (description of general algorithm from http://sierra.nmsu.edu/morandi/coursematerials/JurassicParkFractal.html).  We determine the color of the turtle with an expression designed to increase the red component and decrease the blue component. This will make the curve change from cool to warm, and, depending on the background, create a sense of either unity or depth.​