Instead of giving the exact or absolute position of a point on the screen, its
distance from another point can be given -- this is the relative position of the
point:
The point A in the figure is at 500,200. The point B is 200 to the left and 300
above A, so its relative position is -200,300. This program draws a rectangle
using A and B as the positions of the two comers:
10 MODE 129
20 MOVE 500,200
30 PLOT 97,-200,300
Now change line 20 and RUN the program again:
20 MOVE 300, 100
PLOT 97 tells the computer to draw a rectangle using the two points given,
with the second point being relative to the first point. This means that the
computer always draws the same size rectangle, wherever the first point is
placed. Relative positioning is very useful if a drawing needs to be moved
around on the screen.
The PLOT commands are very versatile and provide a great deal of control over
how images are drawn. Lines or figures can be drawn absolutely or relatively,
solid or dotted, in the foreground or background colour. Figures can be drawn
in outline or as solid blocks of colour. A full list of the PLOT commands is given
in Appendix 8.
C 18