Formalities

Fall term

Section 101

10:0011:00 M W F

Buchanan D225
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 (and even, implicitly, projective)
geometry in a crucial manner.
Elementary 3D graphics including perspective, and
perhaps something about the regular solids, will also be discussed.
A 3D extension to PostScript will be introduced for this purpose.
Towards the end of the term, students
will have to propose and carry out their own projects.
You can even look at some previous years' projects:

M308  Fall 1996.
These were among the earliest a class ever did,
and they wouldn't be acceptable now because of their
low mathematical content. They do illustrate in many cases
a high technical level.

M309
 Fall 1999. These are of much higher mathematical quality,
although the quality varies widely. A few (Dawson, Ting)
are spectacular.

M308  Fall 2002.
Also some spectacular ones.

This year's projects
There are therefore two components to the course:
(1) Euclidean geometry and (2) graphics design,
but of course they interact. Geometry is required to
produce graphics, and graphics can be used to explain geometry.
Geometry
The principal sources are available on the Internet.
Graphics design
Students will be
given accounts in the Mathematics Department undergraduate
computer laboratory, and will also be able to
run GhostScript or GhostView
on PCcompatible machines or Macintoshes elsewhere.
The documentation below is usually in PDF
format, but occasionally in PostScript.
You can obtain a PostScript interpreter at the
GhostView & GhostScript home pages.
For PDF files
Acrobat Reader is available from Adobe.
We have PostScript help on our
local help facility.
In addition, the following are available on line:
More links to information on PostScript can be found at
Luc Devroye's PS
site.
Using the Mathematics Department computers remotely
There are lots of tools available for image manipulation
and other useful tasks
on the Mathematics Department machines, and if you can connect to
one of our machines, you can use them
at home almost as easily as if you
were in the building. There are two
programs you will need to install on
your computer if you are running Windows.
One is ssh, a program
that sets up secure connections over the Internet. This
and its partner programs allow
file transfer and simple terminal interactions.
To get the Mathematics machines to display on your own
machine, you need some kind of X11 windows implementation.
A version of ssh that costs nothing
and that apparently works very well can be downloaded from
PuTTY.
As for X11, try
Cygwin.
Assignments

Assignment 1 (Pythagoras' Theorem)

Assignment 2 (First PostScript assignment)
In #4, you are not allowed to do Euclid's proof, the one
referred to in #1. No rotating triangles. For #2, look at the beginning
of Chapter 6 of the Manual.
What data go into making one of those triangles? Its vertex
and vertex angles? Ideally, you will
make up a procedure that has a few arguments at most
and builds the complete triangle on the chord. Another that
does the angular bit.

Assignment 3

Assignment 4

Assignment 5 due Monday, November 3 
redo the midterm

Solutions to the midterm

Assignment 6  the last assignment

About projects. Read every word
of this before you propose a project. Nothing in it is
superfluous. The absolute deadline for submitting a proposal
is 12:00 noon on Friday, November 28.
None  really, NONE  will be considered after that date, and
your grade on the project will be 0. Nor will
major changes in your proposal be accepted after this.
The deadline for handing in projects is midnight on December 18.
After that, 5% will be taken off for each day late, up to midnight December 22.
PostScript homework should be bundled all into one
file and sent as an attachment to m308grader@math.ubc.ca.
Each question should have a title page, and the assignment as a whole should
have a title page with your name on it. Care should be taken
using gsave ... grestore to make pages independent of each other.
The grader will, if all goes well, grade you on the basis of your pictures
alone, not your code. (God forbid he should ever have to look at it!)
When doing the individual problems, just use one file for each,
but then at the end make them into one large file.
Before finally submitting an assignment, run the whole
file through your PostScript viewer to be sure it works OK.
If we have to send it back to you for silly reasons it will be marked
as if it were late.
Sample code

euclid.ps

animation.ps

curve.ps
 Successive versions of line drawing

perspective.ps

Some sample 3d programs. These are a sequence of programs
illustrating a few tricks of the ps3d
package. Several are animated by pageturning. One thing to realize
is that 2D and 3D graphics commands should be kept separate,
because they affect different parts of
the pipeline that turns ps3d commands into marked points on a page.
 [ 3dA.ps ] A simple unit square with corners
at (0, 0), (1, 0), (1, 1), (0, 1),
seen flat on in `wire frame', and in orthogonal projection.
 [ 3dA.ps  source code ]
 [ 3dB.ps ] The same
square but rotated 45 degrees around
the y axis, and in perspective.
 [ 3dB.ps  source code ]
 [ 3dC.ps ] Now animated in a loop, rotating around the
y axis.
 [ 3dC.ps  source code ]
 [ 3dD.ps ] With the rotation axis shown.
 [ 3dD.ps  source code ]
 [ 3dE.ps ] Now the square is
rotating around its central vertical axis. It demonstrates that
the effect of coordinate changes in ps3d as in ordinary PS is
to move the frame of the coordinate system in which you are drawing.
Note that the original square itself has been shifted left onehalf unit.
 [ 3dE.ps  source code ]
 [ 3dF.ps ] A rotating 2sided square,
with different sides shown by something special to this figure.
 [ 3dF.ps  source code ]
 [ 3dG.ps ] The same effect, but by a more
complicated and versatile technique, using the notion
of a face of a 3d figure as an array of points plus visibility function.
 [ 3dG.ps  source code ]
 [ 3dH.ps ] With shading from a light source.
 [ 3dH.ps  source code ]
 [ 3dI.ps ] With shadows (from a different light source).
 [ 3dI.ps  source code ]
