We have gone over the functional approach to graphics (which is due to Conal Elliott) in lecture, specifically covering the simplified library I wrote to generate "bmp" bit-mapped graphic files from some simple primitive colors, shapes and transformations. In this lab, you will extend this library with some ideas of your own and then produce a picture which demonstrates the new features you came up with.
You can get the files we worked with here:
RasterGraphicsfile and be ready to generate pictures. You will also need to change the file path used in the
writefunction in the
RenderBMPfile, depending on whether you are using a Mac or PC, and to reflect your user name.
Once you have these files downloaded and loaded up into Hugs, you should be able to
generate a file from a Figure by entering "
try fig", where
is the name of your Figure. (You may want to reduce the scale and magnification factors
for speed while you work, then increase them again at the end for better-looking output.)
In your completed project, you should define and use at least the following:
type Figure = Space -> Maybe Color.
skewtransformations defined in my code. Transformations will generally be of type
Figure -> Figure.
If you need help with ideas, or with the math needed to express them, you may look at the following pages for inspiration (these are the ones we looked at in lecture, just re-linked here):
Note, of course, that all work should be your own in the end: you may use these sources for ideas, but don't just snag something here and present it as your own work!