# Mathematics 308 - Fall 1997 - Euclidean geometry

Fall term

Section 101

1:30-2:30 M W F

Buchanan A205

In the course this fall, as in previous years, I will show how mathematics and computers can be used together to produce graphics of mathematical interest. The primary programming language to be used is PostScript. It is ideal for this purpose because its imaging model uses affine geometry in a crucial manner. Towards the end of the course, elementary 3D graphics including perspective, and perhaps something about the regular solids, will be discussed. New this year: I will also allow work in Java, and will arrange weekly tutorials for those interested in it.

Towards the end of the term, students will have to propose and carry out their own projects. You can even look at a previous year's projects.

Students will be given accounts in the Mathematics Department undergraduate computer laboratory, and will also be able to run GhostScript or GhostView on PC-compatible machines or Macintoshes elsewhere. The documentation below is in both PostScript and PDF formats. For reading PostScript you can use GhostView & GhostScript if you do not have another PostScript file browser. For PDF files Acrobat Reader is available from Adobe.

We have PostScript help on our local help facility If you would like to know something that isn't there, ask about it.

## Course notes

Chapter 1 - An informal introduction to PostScript

Chapter 2 - Elementary coordinate geometry

Chapter 3 - Evolution of a simple program

Chapter 4 - Drawing lines: conditionals and coordinates

Chapter 5 - Drawing polygons: loops in PostScript

Chapter 6 - Curves

Chapter 7 - Automatic curve drawing

Chapter 8 - Rigid transformations

Chapter 9 - Drawing in 3D

## Sample PostScript

A pentagon:
the file
the picture

A rotated square:
The source
The picture

A program of two pages:
The source
The picture

A procedure to draw the visible parts of a line on a page in any user coordinate system:
The source
A sample picture

The simple version of mkpath.inc

The 3d matrix manipulation file matrix3d.inc

Projection and perspective procedures as well as routines to construct surfaces are in draw3d.inc

A better error handler than the default one that comes with Ghostscript. It is the same as the one made by Adobe, except that one line of optional output has been suppressed, in order to make it more convenient. To use this program, put (ehandler.ps) run at the beginning of a program.

## Homework

First homework

Euclid's proof of I.47
The picture
Source

Approximating the graph of cos(t) with Bezier curves. The picture has two pages, the second at four times the scale of the first. Note the different graphs drawn with different numbers of Bezier curves: green = 2, blue = 4, black = 8. (Of course this fine point makes the code very difficult to read.)
The picture
Simplified source

## Java graphics notes

Tutorial - Introduction
Tutorial - A simple applet
Tutorial - A simple interactive applet
Tutorial - A simple animated applet

The psplot package:
gzipped (Unix)
zipped (Windows)

The tutorial applets

## Other course material

Pythagoras' Theorem