.he 'TEKTRONIX''Page %'
.fo 'Aaron Sloman'%'1 Jan 1978'
.mh8
USE OF THE TEKTRONIX GRAPHICS TERMINAL
======================================
.hm

The tektronix terminal may either be used on its own, or together with a
VDU, in which case the two terminals are plugged into the C.A.D.C
switching unit, which is then connected to the PDP11.

The lead to the PDP11 comes through the wall between E209 and E209a, at
the north end. Plug either the graphics terminal, or the switching unit
into it.
It is far more convenient to use the switching unit, with both the graphics
terminal and the VDU connected through it.

The other end of the lead will be found near the junction box in the south-west
corner of room E209 (near the card-punching machines). It may either be
plugged into the modem outlet on the junction box, replacing teletype 2,
or else connected to the lead which goes through to room E207, and which
can be connected to the high-speed line, replacing the VDU in there.

In the former case, the Tektronix unit, and, if necessary the VDU
and switching unit, should be switched to 110 baud. In the latter case
they should be left at 1200.

If you do switch them to 110, please reset after use. Note that
at the back of the Tektronix unit there are two separate speed controls, both
of which must be set.

After connecting the terminals, login as usual. You can log in on either the
Tektronix or the VDU. If the latter is the HAZELTINE, then, since it produces only
upper case, you'll have problems if you log in on the Tektronix and later try
typing on the VDU, so it is simplest to use only the VDU if you are not
used to the sytem.
.mh8
THE GRAPHICS PROGRAMS
=====================
.hm
.pg
To use the graphics programs, log in after connecting the terminals as
above. Run POP11. Then type:
 	: LIB GRAPHIC;

This makes available normal POP11 turtle programs modified for drawing pictures
on the screen. The following functions are available:
.nf
DRAWTO
JUMPTO
DRAW
JUMP
TURN
GRESET (clears the screen)

.fi
However, to use these facilities conveniently with switching unit and
VDU linked to the graphics unit, you should first type:
 	: GRAPHIC;

This sets up a special environment which ensures that non-graphical
communications are switched to the VDU, unless over-ridden.
To remind you that you are in this environment, SETGRAPHIC is printed out
instead of SETPOP after error messages, etc.

To leave this mode, either type CTRL D, or SETPOP();


Also, if you type CTRL X to interrupt processing, you'll find that instead of
an immediate SETPOP or SETGRAPHIC, you are in a special interrupt mode
with a double colon for the prompt, i.e. "::" instead of the normal ":".
In this mode, if you type CTRL D, processing will continue beyond the point
of interruption, whereas CTRL X will cause a return to SETGRAPHIC.
.mh8
LIB GRAPHOPS
------------
.hm
As it is rather tedious to use the full length commands given above,
you can compile a set of abbreviated operations, namely
.nf
DT for DRAWTO
JT for JUMPTO
DR for DRAW
JU for JUMP

in addition, instead of TURN, you can use
LT for left turn (i.e. the same as TURN)
RT for right turn (i.e. RT 90 has the same effect as TURN(-90))

Since these are all operations, no parentheses are required. So:
 	: dr 20; lt 90; dr 20; lt 90; dr 20; lt 90; dr 20;
will draw a square.
 	: 0,0 jt; 100, 100 dt;
.br
will jump to (0,0), and draw to (100,100).
.fi
Two further operations are provided:
 	HOME	puts turtle at position (0,0) facing right
 		i.e. heading 0.
 	SHOWGO	makes the cursor on the graphics screen move back and
 		forth, showing the current heading of the turtle.
 		The number of moves is controlled by the variable
 		SHOWGONUM. Default is 10.

To make these operations available type:
 	: LIB GRAPHOPS;

.mh8
GLOBAL VARIABLES
================
.hm
.pg
The origin (0,0) is set to be near the centre of the screen. You can
change it by altering GXORIGIN and GYORIGIN. If you make their values
0,0, then the origin is at the bottom left. The values 1023,790, make
the origin the top right corner.

Scale can be varied.
GXSCALE and GYSCALE control horizontal and vertical stretching and
shrinking. They are initially set to 1. So DRAW(1020); creates a line
1020 screen units long, i.e. the width of the screen.
The height is about 790 units. So Draw(100); creates a line about one inch long.
If you assign 5 to GXSCALE and GYSCALE, then the same command will create a line
five times as long.

The variable CLIPPING (default TRUE) switches clipping of the picture
on and off. If CLIPPING is FALSE, then lines drawn beyond the limits of the
screen will "wrap around".

Boundaries for clipping are controlled by GXMIN,GXMAX,GYMIN,GYMAX, whose default values
are 0,1023, 0,1023.
.br
By altering them you can constrain pictures to appear only in a specified
rectangle on the screen, the excess being suppressed.
.br
N.B. these variables use screen co-ordinates, so their effect is not altered by
changing GXORIGIN, GXSCALE, etc.
(Although notionally the screen extends vertically to Y = 1023, in fact
it is only visible up to about Y=790.)


The GRAPHIC package also contains facilities for reading co-ordinates in
using the GIN (Graphic INput) mode of the terminal. These are used in LIB GINREAD and documented
in the GINREAD demo.

.mh8
THE POLY PROGRAM
================
.hm
The easiest way to use the graphics package is to log in to POP11 then type
 	POLY;
.br
This will load all the graphics programs (if they have not been compiled previously)
and then allow you to generate pictures using the function POLYSPI which
draws "polygonal spirals". It requires four parameters
 	a size for the initial line
 	an increment to be added to the size after drawing each line
 	an angle through which to turn after drawing each line
 	the total number of lines to be drawn

You do not need to call POLYSPI explicitly: POLY will prompt you (on the VDU)
and all you need to do is type in the numbers (each terminated by "return" or
"CR").

After drawing your picture, POLY assumes you want to draw another, and again
prompts you for the initial length. You can exit from POLY by typing CTRL D.
THERE IS NO OTHER MEANS OF LEAVING POLY. After you've left POLY, you'll be
back to POP11.

The interrupt facility (CTRL X) is altered inside POLY, so that instead of
causing a SETPOP it simply restarts POLY. Similarly if there is an error
POLY will be restarted afterwards. Use CTRL X if you want to change your
mind about some parameters, or if a picture is taking too long and you
want to interrupt it.
