doc.txt

Fractal

_Fractal_
_fractal_

This collection provides three file:

 _fractal.ss_: exports everything
 _model.ss_: just the underlying computations
 _window.ss_: the GUI code

This is a fun example of a simple fractal, similar to the Koch curve.

======================================================================

DATA DEFINITIONS -----------------------------------------------------

A direction is one of:

  - 'N
  - 'E
  - 'S
  - 'W

A point is:

  - (cons nat nat)

A segment is:

  - (cons point point)


PROCEDURES -----------------------------------------------------------

> (fractal-window [w 300] [h 300]) :: [nat * nat] -> frame<%>

Displays a window with a fractal image. Click the window to advance to
the next iteration.

> (directions-for n dir) :: nat * direction -> (listof direction)

Computes the segment directions for iteration `n', starting in direction `dir'.

> (fractal-iteration len dirs point) :: nat * (listof direction) * point -> (listof segment)

Computes the list of segments for the directions `dir' computed for an iteration
computed by _directions-for_, with segment length `len' and starting at point
`point'.