next up previous contents index
Next: SUBROUTINE RAMCLOSE Up: Miscellaneous Routines Previous: SUBROUTINE PAUSEP

SUBROUTINE PLOTC

         

 PLOTC is a utility routine to provide an additional, rotatable clip window. While similar to PLOT (which is called by PLOTC), PLOTC allows for viewport window to be rotated in user coordinates. Given the location and orientation of the desired viewport, PLOTC computes the clipped vectors and plots them using PLOT. The PLOTC  window or viewport may be set to an arbitrary size and location and rotated relative to the device coordinate system. Clipping can be disabled if desired. In this case, PLOTC calls PLOT.

The default origin is (ox,oy)=(0,0), the angle (a=0), the scale factor (z=1), the lower-left viewport corner (xll,yll)=(0,0), and the upper-right viewport corner (xur,yur)=(8.5,11). An input point (x,y) point is transformed to (x1,y) by

    x1 = ((x - ox) * cos(a) - (y-oy) * sin(a)) * z
    y1 = ((x - ox) * sin(a) + (y-oy) * cos(a)) * z
A line from (x1,y1) to (x2,y2) is clipped to the window defined by the rectangle with lower-left corner (xll,yll) and upper-right corner (xur,yur) and corresponding points inverse transformed according to,
    xp =  (x1 * cos(a) + y1 * sin(a)) / z + ox
    yp = -(x1 * sin(a) - y1 * cos(a)) / z + oy.
Visible lines are plotted using PLOT. Only PLOT options 2 and 3 are clipped. In addition to plotting visible lines, changes of origin (PLOT option -2 or -3) are passed through PLOTC without clipping.

Unlike PLOT, the plot angle "a" is absolutely set by "x". Similarly, The origin (ox,oy) are absolutely set to (x,y) when PLOTC option code -1 is used. However, the scale factor z is updated according to:

    znew = zold * zin
CALL PLOTC (x,y,i)

x,y   (R): coordinate values
i     (I): plot function parameter
           =  1: set PLOTC viewport rotation angle to "x" deg
                 set PLOTC viewport relative scale factor to y
           = -1: set PLOTC viewport origin to (x,y)
           =  7: set upper right corner of PLOTC viewport to (x,y)
           = -7: set lower left corner of PLOTC viewport to (x,y)
           else: call plot(x,y,i) without PLOTC clipping



David Long
Wed Jun 12 10:34:11 MDT 1996