PLOT is the central routine for controlling the motion of the electronic pen for all LONGLIB graphics device packages. PLOT calls the Ramtek, metafile and terminal PLOT routines PLOTRM, PPLOT, PLOTVT based on the graphics devices initialized by FRAME. These individual "package PLOT" routines can be called separately if desired to affect only the particular package. Via these package-specific plot routines PLOT can moves the pen, change the origin or pen color, issue a page change command, etc. A relative rotation angle for all successive plotting may also be specified. LONGLIB defines a plotting window or viewport, the size of which is device dependent, within which pen motions are clipped. The viewport may be set to an arbitrary size within the device plotting window (e.g. terminal screen). An attempt to make the viewport bigger than the device output will force the viewport to be the device output window (this is the default). For rotated clipping regions see the PLOTC utility.
The transformation from an input point (x,y) in plot units to an output point (nx,ny) in output device unit pixels (ignoring clipping, etc.) is:
nx = (z * (x * cos( a ) - y * sin( a )) + ox) / rx ny = (z * (x * sin( a ) + y * cos( a )) + oy) / ry where a is the relative plotting angle (expressed in radians) z is the zoom scale factor ox,oy is the scaled, rotated relative origin rx,ry is the screen resolution for each axis (inches/pixel)The relative plotting angle a is updated according to:
anew = aold + ainand the relative origin (ox,oy) is updated according to:
oxnew = z * (xin * cos( a ) - yin * sin( a )) + oxold oynew = z * (xin * sin( a ) + yin * cos( a )) + oyold
CALL PLOT (x,y,i) x,y (R): coordinate values i (I): plot function parameter = 0: color control x is the new line color if x < 0 the screen is cleared = 2: draw to (x,y) with 'pen down' = -2: same as i=2. (x,y) becomes new origin = 3: move to (x,y) with 'pen up' = -3: same as i=3. (x,y) becomes new origin = 4: upper right corner of viewport set to (x,y) = -4: lower left corner of viewport set to (x,y) = 5: pick pen up at last point = 6: set relative plotting angle to x = 9: erase to (x,y) (plot with color 0) = -9: erase to (x,y) (x,y) becomes new origin = 10: issue change page command to metafile = 11: end plot (close LONGLIB) =999: end plot (close LONGLIB)