# MCS-177 Project: Fractal Curves

## Due: Wednesday, April 9, at the beginning of class

**MCS 177: Computer Science I, Spring 2003**

**Recommended preparation and
schedule **
## Problem

In this project, you will experiment with tree recursion by looking at
fractal curves. Complete the project and its report individually (not
with partners).
## Computer Exercises

Work through all the exercises of section 4.3 in the text. See below
for notes particularly about exercises 4.7 and 4.8.
One technical tip: if you can't see a fractal with fine details
clearly because it is too small, you can enlarge the image in Scheme
by using the resize-image procedure, which is built-in to our
Scheme. For example,

(resize-image (line 0 0 1 1) 400)

would give you an image of a line from the center of the image to the
upper-right corner, but it would be much larger than usual.
Rather than typing in the definition of c-curve, you can click on the
following file in Netscape and save it somewhere in your home
directory: `~mc27/labs/fractal-curves/c-curve.scm`

**Regarding exercise 4.7:** The examples in the book all involve
c-curves between the points (0,-1/2) and (0,1/2), with just the level
varying. You should also do some examples with other end points.
Your goal should be to determine a formula
`L`(`d`, `n`) for the length of a
level-`n` C-curve between two points distance `d`
apart. (In the book's examples, `d` is always 1. Your
extra examples should vary this.) You need not mathematically prove
that your formula always holds.

**Regarding exercise 4.8:** You should have fun designing your own
fractal. You can also design more than one new fractal. If you do
so, they need not all be of the form described in exercise 4.8 (paths
with detours). Some could be more like Sierpinksi's gasket than like
c-curves, for example.

## Project Report

You should simply turn in a DrScheme printout that shows your
procedures and the tests you did, including the images that resulted
from the tests. For exercise 4.7, you can give your formula for
`L`(`d`, `n`) in a text box, or you
may find it easier to write it in by hand. Be sure to group your work
into logically related sections and put a descriptive heading at the
beginning of each section. Your audience for this report consists of
people already familiar with this assignment.
To get some sense of how this project report will be
graded, look at the grading sheet
that we use.