2.  SYSTEM SUBROUTINES.

      THE <PLOT> FILE DEPENDS UPON A FORTRAN LIBRARY, THAT IS PRESUMABLY
STANDARDIZED FROM ONE COMPUTER INSTALLATION TO ANOTHER.  UNFORTUNATELY
UNIFORMITY IN THIS REGARD IS APT TO BE ONLY APPROXIMATE.  SUCH FORTRAN
LIBRARY FUNCTIONS AS THE SQUARE ROOT, ABSOLUTE VALUE, AND OTHERS OF A
PREDOMINANTLY ARITHMETICAL NATURE ARE INDEED UNIVERSAL, AND REQUIRE VERY
LITTLE FURTHER COMMENT.  SUCH DISCREPANCIES WHICH ARISE DEPEND MOSTLY ON
CONVENTIONS IN FORCE REGARDING DOUBLE PRECISION ARITHMETIC; FOR EXAMPLE
WHETHER AUTOMATIC DOUBLING IS AVAILABLE, OR WHETHER THE DECISION TO USE
DOUBLE PRECISION FUNCTIONS ALSO REQUIRES THE USE OF SPECIAL NAMES.

     SOME OTHER RATHER USEFUL SUBROUTINES HAVE MADE THEIR WAY INTO THE
FORTRAN LIBRARY, INCLUDING CLOCK ROUTINES AND FILE HANDLING ROUTINES.
THESE ARE ALMOST SURE TO VARY FROM ONE COMPUTER BRAND TO ANOTHER, AND
MAY EVEN VARY FROM ONE PDP-10 TO ANOTHER.  SUCH SUBROUTINES NEED TO BE
DESCRIBED SUFFICIENTLY THAT REPLACEMENTS FOR THEM MAY BE MADE WHENEVER
NECESSARY.  WE OURSELVES HAVE INVENTED ONE SPECIAL SUBROUTINE TO ALLOW
US TO OBTAIN THE PROGRAM'S JOB NUMBER.

      THE FOLLOWING FUNCTIONS SHOULD BE FOUND TO BE FULLY STANDARDIZED:

        ABS     ABSOLUTE VALUE OF REAL ARGUMENT
        AIMAG   IMAGINARY PART OF COMPLEX ARGUMENT
        ALOG10  LOGARITHM BASE 10
        AMAX1   REAL MAXIMUM OF REAL ARGUMENTS
        AMIN1   REAL MINIMUM OF REAL ARGUMENTS
        ATAN2   ARCTANGENT OF QUOTIENT OF TWO ARGUMENTS
        CABS    REAL ABSOLUTE VALUE OF COMPLEX ARGUMENT
        COS     COSINE OF RADIAN ARGUMENT
        COSD    COSINE OF DEGREE ARGUMENT
        COSH    HYPERBOLIC COSINE
        FLOAT   INTEGER TO REAL CONVERSION
        IABS    INTEGER ABSOLUTE VALUE OF INTEGER ARGUMENT
        IFIX    REAL TO INTEGER CONVERSION
        ISIGN   INTEGER TRANSFER OF SIGN
        MAX0    INTEGER MAXIMUM OF INTEGER ARGUMENTS
        MIN0    INTEGER MINIMUM OF INTEGER ARGUMENTS
        MOD     INTEGER REMAINDER
        REAL    REAL PART OF COMPLEX ARGUMENT
        SIGN    REAL TRANSFER OF SIGN
        SIN     SINE OF RADIAN ARGUMENT
        SIND    SINE OF DEGREE ARGUMENT
        SINH    HYPERBOLIC SINE
        SQRT    SQUARE ROOT
        TANH    HYPERBOLIC TANGENT

     THE FOLLOWING SUBROUTINES ARE LIKELY NOT TO BE STANDARDIZED:

        DATE    ASCII VERSION OF TODAY'S DATE
        SYSJO   ASCII VERSION OF PROGRAM AND PROJECT NUMBERS
        TIME    ASCII VERSION OF CLOCK TIME

HOWEVER, THEIR FUNCTION SHOULD BE SUFFICIENTLY OBVIOUS THAT THEY CAN
BE REPLACED FOR ANOTHER MACHINE WHEN IT SHOULD BE REQUIRED.
3.  PLOTTER SUBROUTINES

     HERE WE OFFER A RESUME OF THE PLOTTER SUBROUTINES, IN ORDER TO HAVE
CLEARLY DEFINED THEIR CALLING SEQUENCES AND THE MEANING OF EACH OF THEIR
ARGUMENTS.

      SUBROUTINE  PLOTS (I)

C     [INITIALIZE PLOTTER]
C     I   STATUS OF PLOTTER
C           I= 0 (.FALSE.)  PLOTTER READY
C           I=-1 (.TRUE.)   PLOTTER UNAVAILABLE
C     MOST USERS WILL FIND THAT THEIR PLOTTER OUTPUT IS BEING SPOOLED
C     AND THEREFORE THAT A CALL TO PLOTS WILL NEVER FAIL.  HOWEVER,
C     THIS CALL MUST NOT BE OVERLOOKED AS AN INITIALIZING STEP BECAUSE
C     IT CLEARS THE ORIGIN, SETS UP THE OUTPUT BUFFERS, MAKES SURE
C     THAT THE PEN GETS RAISED, ALL OF WHICH ARE REQUIRED TO SET THINGS
C     GOING.
C     [00-XXX-00]


      SUBROUTINE  PLOT (X,Y,L)

C     [MOVE PEN]
C     (X,Y)  DESTINATION OF PEN, IN INCHES
C     L      RAISE OR LOWER PEN
C               L=1  NO CHANGE IN PEN STATUS
C               L=2  LOWER PEN BEFORE MOVEMENT
C               L=3  RAISE PEN BEFORE MOVEMENT
C            L NEGATIVE HAS SAME EFFECT AS IABS(L), WITH THE EXCEPTION
C            THAT THE DESTINATION BECOMES A NEW ORIGIN.  THE OUTPUT
C            BUFFER IS ALSO FLUSHED, BUT THE PLOTTER IS NOT RELEASED.
C     TO GIVE THE COORDINATES OF THE DESTINATION ONE HAS TO KNOW THE
C     SIZE OF PLOTTER WHICH IS TO BE USED, WHICH CAN BE EITHER 11" FOR
C     THE SMALL PLOTTER, MODEL 565, OR 29.5" FOR THE LARGE PLOTTER,
C     MODEL 563.  THE SMALLEST VIABLE INCREMENT ALSO VARIES WITH
C     PLOTTER MODEL, BEING 0.01" FOR THE SMALL PLOTTER, AND 0.005"
C     FOR THE LARGE PLOTTER, THESE BEING THE MACHINES AVAILABLE AT
C     SALAZAR AND THEIR RESPECTIVE INCREMENTS.  ALSO NOTE THAT (X,Y)
C     FOLLOW THE CALCOMP COORDINATE CONVENTIONS, X POSITIVE UPWARDS
C     ALONG THE DRUM PERIPHERY AND Y POSITIVE TO THE LEFT ALONG THE DRUM
C     AXIS.
C     [00-XXX-00]


      SUBROUTINE  SYMBOL (X,Y,H,SYM,TH,N)

C     [DRAW ASCII TEXT]
C     (X,Y)  COORDINATE IN INCHES OF LOWER LEFT HAND CORNER OF AN
C            IMAGINARY RECTANGULAR BOX CONTAINING THE TEXT
C     H      HEIGHT, IN INCHES, OF THE BOX CONTAINING THE TEXT
C     SYM    ALPHANUMERIC VARIABLE CONTAINING THE ASCII TEXT
C     TH     ORIENTATION OF THE BOX CONTAINING THE TEXT, IN DEGREES,
C            MEASURED COUNTERCLOCKWISE FROM THE X-AXIS.
C     N      NUMBER OF CHARACTERS COMPRISING THE TEXT
C     [00-XXX-00]


      SUBROUTINE  NUMBER (X,Y,H,FNUM,TH,ND)

C     [DRAW NUMBER]
C     (X,Y)   CARTESIAN COORDINATES, IN INCHES, OF THE LOWER LEFT HAND
C             CORNER OF AN IMAGINARY RECTANGULAR BOX IN WHICH THE DIGITS
C             OF THE NUMBER WILL BE DRAWN, LEFT JUSTIFIED.
C     H       HEIGHT OF THE BOX IN WHICH THE NUMBER WILL BE DRAWN
C     FNUM    THE NUMBER WHOSE VALUE IS TO BE DRAWN
C     TH      INCLINATION, IN DEGREES, COUNTERCLOCKWISE FROM HORIZONTAL,
C             OF THE BOX IN WHICH THE NUMBER IS TO BE DRAWN
C     ND      NUMBER OF DECIMALS TO THE RIGHT OF THE POINT TO BE DRAWN.
C             IF ND IS NEGATIVE, THE DECIMAL POINT AND FRACTIONAL DIGITS
C             ARE ALL SUPPRESSED
C     TO DRAW AN INTEGER, IT SHOULD BE FLOATED, AND THEN NUMBER CALLED
C     WITH ND NEGATIVE.
C     [00-XXX-00]


      SUBROUTINE  WHERE (X,Y)

C     [CURRENT PEN LOCATION]
C     (X,Y)   CARTESIAN COORDINATES OF THE CURRENT PEN LOCATION
C     PRESUMABLY A SUBROUTINE TO BE USED BY PEOPLE WHO HAVE CALLED
C     A SUBROUTINE WHICH INITIATES MANY PEN MOVEMENTS, AND THEN WISH
C     TO KNOW WHERE THE PEN FINALLY ENDED UP.
C     [00-XXX-00]


      SUBROUTINE  SCALE (X,N,S,XM,DX)

C     [SELECT SCALE FOR AXIS SUBROUTINE]
C     X(N)   ARRAY OF VALUES TO BE SCALED
C     S      NUMBER OF INCHES ALLOCATED TO THE GRAPH
C     XM     ROUNDED MINUMUM IN THE ARRAY, SET BY SCALE
C     DX     DATA INCREMENT PER INCH, CALCULATED BY SCALE
C     [00-XXX-00]


     THE PDP-10 FORTRAN LIBRARY ORIGINALLY CONTAINED ANOTHER SUBROUTINE,
CALLED AXIS, WRITTEN IN FORTRAN, WHICH WAS DESIGNED TO DRAW AXES, AND
LABEL THEM WITH TIC MARKS, NUMERICAL VALUES AND CAPTIONS. IT IS NOT
MENTIONED HERE BECAUSE IT HAS BEEN REVISED SOMEWHAT AND INCORPORATED IN
THE <PLOT> FILE UNDER THE NAME PLTAX.

     THE PLOTTER SUBROUTINES HAVE TO BE ACCEPTED AS A STARTING POINT TO
ENSURE COMPATIBILITY WITH OTHER PDP-10 INSTALLATIONS.  VIOLATION OF THIS
PRECEPT WOULD PROBABLY NOT PRODUCE VERY SEVERE REPERCUSSIONS, BECAUSE
THE PLOTTER SUBROUTINE CONVENTIONS ESTABLISHED BY OTHER MANUFACTURERS DO
NOT COINCIDE VERY WELL WITH THE PDP-10 NORMS, NOR DO THE PDP-10 NORMS
SEEM TO HAVE BEEN PARTICULARLY WELL THOUGHT OUT.  THUS CHANGES WOULD
INVOLVE LITTLE MORE THAN PROVIDING MACHINE LANGUAGE ALTERNATIVES FOR
THE VITAL SUBROUTINES PLOT AND PLOTS, AND A MEANS OF READING TABLES OF
THE PEN STROKES DEFINING THE SYMBOLS TO BE USED BY SYMBOL AND NUMBER.
ADAPTATION OF THE <PLOT> FILE FOR A COMPLETELY DIFFERENT COMPUTER WILL
USUALLY REQUIRE A COMPLETE REDEFINITION OF THE PLOTTER SUBROUTINES IN
TERMS OF THEIR EQUIVALENTS IN THE OTHER COMPUTER.  A SIMILAR PROBLEM
ARISES CHANGING TO ANOTHER BRAND OF PLOTTER, TO A VISUAL DISPLAY DEVICE,
OR TO ANOTHER STYLE OF PLOTTER.

     IT IS PROBABLY WORTH LISTING THE PRINCIPAL COMPLAINTS AGAINST
THE PDP-10 PLOTTER SUBROUTINES, BECAUSE THEY WILL SERVE AS A WARNING
AGAINST SOME PROGRAMMING SITUATIONS WHICH MIGHT BECOME RATHER AWKWARD.

     IT IS ONLY POSSIBLE TO DEFINE THE ORIGIN BY MOVING THE PEN TO THE
ACTUAL SITE.  IN PRACTICE, ORIGINS ARE DEFINED FOR THEIR PROGRAMMING
CONVENIENCE, NOT BECAUSE THE PEN HAPPENS TO BE LOCATED IN THE VICINITY.
NOTHING JUSTIFIES INTERPOSING ADDITIONAL BOOKKEEPING BETWEEN THE USER'S
PROGRAM AND PLOT, HENCE THE ORIGIN SHOULD BE DEFINABLE WITHOUT REQUIRING
ANY PEN MOVEMENT.  AS IT IS, WASTED PEN MOVEMENT OFTEN RESULTS FROM A
FREQUENT SHIFTING OF ORIGIN.  A DESIRED ORIGIN MAY EVEN LIE BEYOND THE
MARGIN OF THE PLOTTER, AND SO BE UNATTAINABLE.  JUST THINK: ONE DOES NOT
HAVE TO TRAVEL TO LONDON IN ORDER TO USE THE GREENWICH MERIDIAN.

     SIMILARLY, PLOT SHOULD BE ABLE TO CHANGE SCALE, TRANSLATE, OR MAYBE
EVEN ROTATE THE COORDINATES WHICH IT RECEIVES.  STILL MORE COMPLICATED
TRANSFORMATIONS MIGHT NOT BE UNREASONABLE, BUT ONE WANTS TO KEEP PLOT
AS SIMPLE AS POSSIBLE.  HOWEVER, OUR CONFRONTATION WITH THE EXISTENCE OF
TWO PLOTTERS, EACH WITH ITS OWN PAPER SIZE AND ITS OWN INCREMENTAL STEP,
HAS EMPHASIZED THE DESIRABILITY OF EASILY PROGRAMMABLE RELOCATIONS AND
SCALE CHANGES.

     THE ROUNDING ALGORITHM WHICH CALCULATES THE DISCRETE PEN INCREMENTS
IS NOT SYMMETRICAL; CONSEQUENTLY TRACING THE SAME LINE IN TWO DIRECTIONS
DOES NOT RETRACE THE SAME PATH, QUITE ASIDE FROM ANY ASYMMETRIES IN THE
JITTER OF THE CALCOMP DRUM.  THE PROBABLE REMEDY IS TO TAKE A FIXED
ORDERING OF THE ENDPOINTS, RATHER THAN THE ORDER OF THEIR PRESENTATION.
THE ASYMMETRICAL ALGORITHM PERMITS THE TRACING OF HEAVIER LINES BY
GOING OVER THEM IN BOTH DIRECTIONS, BUT THE EFFECT IS DEPENDENT ON THE
SLOPE OF THE LINE.  ECONOMIZING PEN MOTION BY USING STROKES IN BOTH
DIRECTIONS RESULTS IN AN UNEVEN APPEARANCE IN THE SPACING OF PARALLEL
LINES, WHICH IS VERY DISTRACTING WHEN THE LINES ARE CLOSE.

     THE SUBROUTINE NUMBER LEFT PACKS THE DIGITS WHICH IT DRAWS, WHICH
INDICATES THAT A MINIMAL PROGRAMMING EFFORT WAS MADE IN ITS CREATION,
WITH THE PRACTICAL CONSEQUENCE THAT THE DECIMAL POINT IN A COLUMN OF
FIGURES IS NOT ALIGNED FOR NUMBERS OF VARYING LENGTHS.  THEREFORE THE
BURDEN OF CALCULATING INITIAL COORDINATES IS MADE EVEN HEAVIER FOR THE
PROGRAMMER; UNFORTUNATELY HE MAY NOT EVEN KNOW THE EXPECTED NUMBER OF
DIGITS AT THE TIME OF WRITING A PROGRAM.  IT IS ACCEPTED ENGINEERING
PRACTICE TO WRITE A ZERO IN FRONT OF AN OTHERWISE NAKED DECIMAL POINT,
BUT NUMBER ALSO OMITS THIS DETAIL.

     THE SUBROUTINE WHERE, WHICH REPORTS THE PEN POSITION, DOES NOT
REPORT WHETHER THE PEN IS RAISED OR LOWERED, NOR IS THIS INFORMATION
AVAILABLE FROM ONE OF THE OTHER SUBROUTINES.  HOWEVER, THE OCCASION TO
USE WHERE HAS NEVER PRESENTED ITSELF.  IT MUST BE SAID IN FAVOR OF THE
PLOTTER SUBROUTINES THAT PLOT ALWAYS CHECKS THE PEN POSITION AND NEVER
ISSUES A SUPERFLUOUS RAISING OR LOWERING INSTRUCTION.  SUCH INSTRUCTIONS
ARE VERY TIME CONSUMING AND MUST BE AVOIDED IF POSSIBLE.

     IN ADDITION TO THE PROBLEMS MENTIONED ABOVE, THERE WERE FOUND ALSO
SOME ANNOYING CHARACTERISTICS OF THE SPOOLER PROGRAMS IN THE TIMESHARING
MONITOR.  ONE OF THEM IS THE FACT THAT IT IS IMPOSSIBLE TO EJECT ZERO
NUMBER OF RECORDS BETWEEN JOBS, SO THAT THE BEST WE HAVE BEEN ABLE TO DO
IS RESTRICT THE PEN CREEP BETWEEN JOBS TO TWO PEN INCREMENTS.  THIS CAN
CAUSE PROBLEMS IF MULTIPLE TRACINGS ARE TO BE MADE OF THE SAME GRAPH, IN
DIFFERENT COLORS OR PEN WIDTHS, FOR INSTANCE.  WE HAVE BEEN RELUCTANT TO
MODIFY PLT00 TO COMPENSATE THIS CREEPAGE, BUT THAT WOULD BE A POSSIBLE
REMEDY.

     EVEN THOUGH MACHINE LANGUAGE INSTRUCTIONS EXIST TO DETECT WHETHER
OR NOT THE PLOTTER IS TURNED ON, THAT THE SPOOLER TAKES NO NOTICE OF THE
PLOTTER STATUS CAN RESULT IN THE LOSS OF GRAPHS THROUGH PROGRAMMER OR
OPERATOR INATTENTION. THIS NEGLECT IS IN MARKED CONTRAST TO THE STATE OF
DEVELOPMENT OF THE PRINTER SPOOLER, WHICH DETECTS WHETHER THE PRINTER IS
RUNNING, WHETHER IT IS TURNED OFF DURING THE COURSE OF PRINTING, WHETHER
THE PAPER TEARS DURING PRINTING, AND SO ON.


4.  FRAMING AND PAGE CONTROL

     ALTHOUGH BOTH THE 11" AND THE 29 1/2" PLOTTERS ARE AVAILABLE FOR
USE, THE PLOT FILE HAS BEEN EXCLUSIVELY ADAPTED TO THE 11" PLOTTER. THE
MOTIVATION HAS BEEN THAT LETTER SIZED GRAPHS ARE QUITE CONVENIENT TO 
MOUNT IN NOTEBOOKS, AS WELL AS THE SUSPICION THAT THIS WOULD BE THE MOST
LIKELY PLOTTER SIZE TO BE ENCOUNTERED IN OTHER COMPUTER CENTERS.  THUS
WE HAVE BEEN CONTENT TO SPECIALIZE IN THE ONE SIZE ONLY, WHICH IS A
SINGLE LETTER SIZED PAGE, WHICH OUGHT TO BE VIEWED LENGTHWISE FROM A
HORIZONTAL POSITION RATHER THAN FROM THAN VERTICAL POSITION.  SO IT IS
THAT THE STANDARD PAGE IS 8 1/2" HIGH AND 11" WIDE.

     THERE IS A CYCLE OF PAGE POSITIONING WHICH IS GENERALLY FOLLOWED,
WHICH IS INDEPENDENT OF THE CONTENTS OF THE INDIVIDUAL PAGE.  FIRST OF
ALL, THERE IS AN INITIALIZATION USING THE PLOTTER SUBROUTINE PLOTS WHICH
IS OBLIGATORY.  WE HAVE COMBINED THE CALL TO PLOTS WITH AN INITIAL PEN
POSITIONING MOVEMENT.  IN THE EXPECTATION THAT THERE WILL NEVER BE
RETROGRESSIVE PAGE MOVEMENT, NO INITIAL ROTATION OF THE DRUM IS MADE.
THIS CAN CAUSE PROBLEMS WHEN THE PREVIOUS GRAPH HAS BEEN INTERRUPTED OR
IF THE PREVIOUS PLOTTING PROGRAM HAS NOT FINISHED PROPERLY. THE PLOTTER
SPOOLER DOES NOT CHECK FOR THE SUCCESSFUL TERMINATION OF A JOB, SO THAT
SUCH DETAILS MUST BE WATCHED BY THE OPERATOR.  HOWEVER, AN INITIAL
HORIZONTAL EXPLORATION IS MADE BY ATTEMPTING TO MOVE THE PEN 11" TO THE
RIGHT.  UNLESS THE PEN WAS ORIGINALLY AT THE LEFT MARGIN, IT WILL BE RUN
UP AGAINST THE RIGHT HAND INTERLOCK, THEREAFTER REMAINING POSITIONED AT
THE RIGHT HAND MARGINAL STOP.

     THE RIGHT HAND MARGIN IS CHOSEN IN PREFERENCE TO THE LEFT HAND
MARGIN BECAUSE OF THE WAY THE ROLLS OF PAPER ARE PERFORATED.  DRIVING
THE PEN TO THE LEFT HAND MARGIN CAN POSITION THE PEN OVER THE LARGE
OVAL HOLES WHICH COMPENSATE IRREGULARITIES IN HOLE PUNCHING OR PAPER
SHRINKAGE.  BALL POINT PENS WILL RIDE OVER THE HOLES, ALTHOUGH THEY MAY
MARK THE DRUM BELOW, BUT INK PENS WILL CERTAINLY CATCH IN THE HOLES AND
TEAR THE PAPER, BESIDES BEING QUITE LIKELY TO SMEAR THE DRUM.

     UNFORTUNATELY THERE IS SOME PLAY IN THE MICROSWITCH WHICH SENSES
ENCROACHMENT ON THE MARGIN, SO THAT RUNNING THE PEN OUT TO THE EDGE OF
THE PAPER HAS NOT TURNED OUT TO BE A VERY REPRODUCIBLE METHOD OF PEN
POSITIONING.

     ONCE THE PEN HAS BEEN DRIVEN INTO THE MARGIN, ITS RESTING POSITION
BECOMES A NEW ORIGIN FOR ALL THE ROUTINES WHICH FOLLOW.  THE SUBROUTINE
PLT00 INCORPORATES ALL OF THESE THINGS, THE INITIALIZING CALL, THE PEN
POSITIONING, AND THE DEFINITION OF THE ORIGIN. IT WILL USUALLY BE CALLED
ONLY ONCE IN ANY GIVEN PROGRAM.

     INITIALIZATION ACHIEVED, THERE FOLLOW PROGRAMS WHICH DEFINE THE
INDIVIDUAL PAGES, USUALLY CIRCUMSCRIBING THEM WITH A BORDER.  ALTHOUGH
NOT STRICTLY NECESSARY, THE EXPLICIT BORDER AIDS IN CUTTING THE PAGES
APART AFTER A SERIES OF GRAPHS HAS BEEN DRAWN, AND ALSO SERVES TO START
THE INK FLOW IN A PEN WHICH MAY HAVE BEEN SITTING IDLE FOR A WHILE.
SOME MARGINAL NOTATIONS HAVE ALSO PROVED CONVENIENT, INCLUDING THE
PROJECT-PROGRAMMER NUMBER TO IDENTIFY THE OWNER OF THE GRAPH AND THE
DATE, TO ASSIST IN IDENTIFYING THE POSITION OF THE GRAPH IN A SEQUENCE.
IT IS FREQUENTLY USEFUL TO BE ABLE TO REFER BACK TO THE DATE ON WHICH
SOME PARTICULAR WORK WAS DONE.

     TWO PROGRAMS ARE AVAILABLE TO DRAW THE MARGINS, PLTFR [FRAME] AND
PLTBO [BORDER]. THEY DIFFER WITH RESPECT TO AN INNER MARGIN, 1" FROM THE
OUTER MARGIN, WHICH IS DRAWN BY PLTBO BUT NOT PLTFR.  BOTH PLTBO AND
PLTFR REDEFINE THE ORIGIN, LEAVING THE ORIGIN AT THE CENTER OF THE PAGE.
A CENTRAL ORIGIN HAS MANY ADVANTAGES, INCLUDING A SLIGHT SIMPLIFICATION
OF THE MARGIN PROTECTION SUBROUTINES.  HOWEVER, MANY ORIGIN CONVENTIONS
EXIST WITH NO REASON TO SELECT ONE AND EXCLUDE OTHERS, SO THAT SOME
SHIFTING OF ORIGIN MAY BE REQUIRED DURING THE COURSE OF PREPARATION OF A
COMPLICATED GRAPH.  SO FAR, THESE SHIFTS HAVE ALWAYS BEEN CARRIED OUT
IMPLICITLY, SO THAT PLOT, AS WELL AS THE MARGIN PROTECTION SUBROUTINES
PLTMS AND PLTMC, ALWAYS PERCEIVES THE ORIGIN TO BE THE PAGE CENTER.

     FINALLY, THERE IS A SUBROUTINE, PLTEJ, WHICH MOVES THE DRUM AND
RESETS THE ORIGIN AT THE LOWER RIGHT HAND CORNER, THEREBY EJECTING THE
PREVIOUS PAGE AND PREPARING FOR A NEW ONE.  PLTEJ ASSUMES THAT THE OLD
ORIGIN WAS AT THE PAGE CENTER.

     LOGICALLY THERE SHOULD HAVE BEEN A TERMINATION SUBROUTINE, MAINLY
TO INSURE THAT ALL OUTPUT BUFFERS WERE FLUSHED AND ALL FILES WERE CLOSED
IN THE OUTPUT DEVICES.  THESE TASKS ARE PERFORMED BY THE FORTRAN LIBRARY
SUBROUTINE RELEASE.  A PROGRAM WHICH CONTROLLED THE PLOTTER DIRECTLY AND
USED THE PLOTTER FOR ONLY A SHORT FRACTION OF ITS OWN DURATION SHOULD
CALL RELEASE, TO MAKE THE PLOTTER AVAILABLE TO OTHER USERS. WHEN PLOTTER
OUTPUT IS SPOOLED, THIS COURTESY IS NOT REQUIRED.  SINCE CALL EXIT ALSO
ATTENDS TO A VARIETY OF TERMINATION CHORES, WE HAVE NOT INCORPORATED ANY
TERMINATION SUBROUTINE INTO THE <PLOT> FILE.

     PAGE CONTROL THEREFORE APPEARS TO FOLLOW A CYCLE, WHICH IS THE
FOLLOWING:

          A.  PLT00 INITIALIZES THE PLOTTING SEQUENCE, PLACING
              THE ORIGIN AT THE LOWER RIGHT HAND OF THE PAGE.
          B.  PLTBO OR PLTFR OUTLINE THE PAGE, INSCRIBE A LEGEND,
              AND SET THE ORIGIN AT THE PAGE CENTER.
          C.  THE GRAPH BELONGING TO THE PAGE IS GENERATED, ALWAYS
              USING THE CENTER AS ITS ORIGIN.
          D.  PLTEJ POSITIONS THE PEN AND THE DRUM FOR THE NEXT
              PAGE, WITH LOWER RIGHT HAND ORIGIN.
          E.  THE PROCESS IS REPEATED FROM B TO CREATE THE DESIRED
              NUMBER OF PAGES.

     THE FINAL CALL TO PLTEJ SHOULD NOT BE OMITTED; OTHERWISE THE NEXT
JOB IS LIKELY TO START OFF DRAWING A SEQUENCE OF GRAPHS BEGINNING FROM
THE CENTER OF THE LAST OF ONES OWN GRAPHS. ALTHOUGH IT WOULD BE POSSIBLE
TO GUARD AGAINST SUCH OVERLAPPAGE BY ALLOWING THE SPOOLER TO INTERSPERSE
AMPLE PAPER BETWEEN JOBS, THE SCARCITY OF PAPER AND ITS COST COMMEND
EACH USER TO FOLLOW THE RECOMMENDED DISCIPLINE FOR PAPER POSITIONING.

     THE CYCLE OF ORIGINS, AS WELL AS THE CYCLE OF PEN MOVEMENTS WITHIN
EACH SUBROUTINE, IS ARBITRARY TO A CERTAIN EXTENT, BUT DOES REFLECT A
MODEST EFFORT TO ECONOMIZE PEN MOVEMENT BY LEAVING THE PEN AT THE END OF
EACH STEP IN A FAVORABLE POSITION FOR THE FOLLOWING STEP.  SOME WASTE
MOTION IS UNAVOIDABLE WHEN THE PEN HAS TO BE PHYSICALLY PRESENT AT A
DESIRED ORIGIN.


5.  MARGIN CONTROL

     MARGIN CONTROL EXACTS A CERTAIN OVERHEAD, PARTICULARLY WHEN IT
INTERVENES IN EVERY PEN MOVEMENT.  YET, IT RETURNS ENOUGH ADVANTAGES
TO JUSTIFY ITS USAGE.  ONE REASON IS THAT IT IS DESIRABLE TO PROTECT
ADJOINING GRAPHS, ESPECIALLY WHEN THEY ARE PACKED AS CLOSELY AS WE ARE
ACCUSTOMED TO PLACING THEM.  EXPERIENCED PROGRAMMERS STILL MAKE ERRORS
OF JUDGEMENT IN ASSIGNING SCALES, WHILE NOVICES WILL INEVITABLY LAUNCH
THE PLOTTER ON HUNDRED MILE GOOSE CHASES IN ARBITRARY DIRECTIONS.

     NOT ONLY IS THE WASTAGE OF PAPER, OR DAMAGE TO NEIGHBORING GRAPHS,
A CONCERN IN MARGIN PROTECTION.  DUE TO THE INCREMENTAL NATURE OF THE
CALCOMP DIGITAL PLOTTERS, THE PLOTTER ITSELF HAS NO RECORD OF THE ORIGIN
AND THEREFORE CANNOT RECOVER WHEN THE PEN RUNS OFF THE PAPER, OR STRIKES
THE HORIZONTAL LIMITING SWITCHES.  IF THE BOUNDS ARE EVER ONCE EXCEEDED
THE WHOLE REMAINDER OF THE GRAPH IS DISTORTED, ALONG WITH WHATEVER
INFORMATION IT MIGHT HAVE CONTAINED.  IT IS WORTH SALVAGING AS MUCH OF
AN OVERSIZED GRAPH AS POSSIBLE, EITHER BECAUSE IT MAY STILL BE USABLE,
OR BECAUSE OF THE DIAGNOSTIC INFORMATION WHICH THE REMNANTS MAY CONTAIN.

     PROJECTIVE GEOMETRY REVEALS METHODS TO CONSTRUCT WINDOWS COMBINING
QUITE ARBITRARY CONVEX POLYGONS, BUT THE OVERHEAD FACTOR COMPELS US TO
SELECT THE SIMPLEST WINDOW, A RECTANGLE OF THE DIMENSIONS OF THE INNER
MARGIN OF THE PAGE, AND CHECK THE MARGINS ACCORDING TO THE ABSOLUTE
VALUES OF THE PROPOSED COORDINATES.  TWO DIFFERENT SUBROUTINES MOVE THE
PEN WITHIN LIMITED MARGINS, NAMELY PLTMS [MARGIN SUPPRESSED] OR PLTMC
[MARGIN COMPRESSED].

     BOTH THESE SUBROUTINES ESTABLISH AN INNER MARGIN 1" FROM THE OUTER
MARGIN, AND BOTH USE LINEAR INTERPOLATION TO DETERMINE THE EXACT POINT
OF INTERSECTION OF A LINE WHICH IS ABOUT TO BE DRAWN WITH THE MARGIN.
THEY DIFFER WITH RESPECT TO THEIR TREATMENT OF ANY PORTION OF THE GRAPH
LYING OUTSIDE THE MARGIN.  PLTMS SUPPRESSES THE EXCESS, MAKING IT A TRUE
WINDOWING ROUTINE.  PLTMC DRAWS THE PARTS OF THE GRAPH WHICH LIE BEYOND
THE MARGIN, BUT DIVIDES EACH LINE UP INTO SEVERAL SEGMENTS, AND SCALES
THEM BY A HYPERBOLIC TANGENT TRANSFORMATION WHICH COMPRESSES THE RANGE
FROM THE MARGIN TO INFINITY INTO THE INCH GAP SEPARATING THE MARGINS.

     EACH ROUTINE HAS ITS USES.  PLTMS PRODUCES CLEANER GRAPHS, BUT MAY
GIVE LITTLE INFORMATION ABOUT WHAT IS HAPPENING OUTSIDE THE WINDOW.
PLTMC RETAINS THIS INFORMATION BUT IF THE OVERRUN OF THE GRAPH IS SEVERE
IT MAY BE TOO CRAMMED INTO THE MARGIN TO DECIPHER.  IN ANY EVENT, THE
MARGINAL EXCURSIONS CREATED BY USING PLTMC ARE NOT INTENDED TO HAVE HIGH
PRECISION, AND PLTMC SHOULD NEVER BE USED TO SUPPLANT PROPER SCALING.

     INDEED, A KNOWLEDGEABLE PROGRAMMER WILL OFTEN APPLY LOGARITHMIC,
HYPERBOLIC TANGENT, OR SIMILAR TRANSFORMATIONS TO HIS DATA BEFORE THEY
ARE GRAPHED TO KEEP DATA VARIATION WITHIN BOUNDS.  CONSEQUENTLY MARGIN
CHECKING IS ONLY INTENDED AS A SAFEGUARD AGAINST ACCIDENTS. THEREFORE IT
SHOULD BE KEPT AS SIMPLE AS POSSIBLE, AND CAN BE QUITE RUDIMENTARY FROM
THE POINT OF VIEW OF WINDOWING PROCEDURES.

     VERY FEW SUBROUTINES OF THE <PLOT> FILE CALL PLOT DIRECTLY, NAMELY:
PLT00, PLTAX, PLTBO, PLRBS, PLTEJ, PLTFR, PLTMC, PLTME, PLTMS.  OF THESE
PLTME IS A SATELLITE OF PLTMC, PLTMS AND PLTMC ARE THE SUBROUTINES UNDER
DISCUSSION, PLTAX IS UNADAPTED, AND THE REMAINDER NEVER ARE USED IN THE
GENERATION OF THE PAGE ITSELF, ALTHOUGH IF REALLY NECESSARY THEY COULD
PRESUMABLY BE WRITTEN USING PLTMS AND PLTMC.  ADDITIONALLY, SEVERAL
SUBROUTINES CALL SYMBOL AND NUMBER, WHICH ALSO GENERATE PEN MOVEMENTS.
THEREFORE, IT IS REASONABLE TO CLAIM THAT PLTMS AND PLTMC ARE THE PEN
MOVEMENT SUBROUTINES OF THE <PLOT> FILE, USED EXCLUSIVELY BY ALL HIGHER
LEVEL SUBROUTINES.  IT IS THEREFORE INSTRUCTIVE THAT THEIR COMMON FORM
OF ARGUMENT, (X,Y,L), CONSISTING OF THE COORDINATES OF THE DESTINATION
OF THE PEN AND A PREDICATE EXPRESSING THE VISIBILITY OF THE IMPENDING
PEN STROKE, SUFFICE FOR ALL THE PEN MOVEMENT WHICH OCCURS.  EXCEPT FOR
THE DEFINITION OF A NEW ORIGIN, THIS ARGUMENT CONSTRUCTION WOULD SUFFICE
FOR ALL PEN MOTION.  THIS IS AN ITEM TO BE BORNE IN MIND WHEN DESIGNING
PLOTTER SUBROUTINES IN MACHINE LANGUAGE.

     IN ORDER TO RELY UPON A SINGLE ENDPOINT AS ARGUMENT, AND YET TO
RETAIN THE IDENTITY OF THE LINE BEING DRAWN, BOTH PLTMC AND PLTMS HAVE
INDIVIDUAL INTERNAL MEMORIES.  THE EXISTENCE OF TWO SEPARATE MEMORIES IS
EXPLOITED NOW AND THEN BY OTHER SUBROUTINES, PARTICULARLY PLTRI. ANOTHER
MEMORY RESIDES IN PLOT, ACCESSIBLE THROUGH THE PLOTTER SUBROUTINE WHERE.


6.  AXES, LABELS, AND MARKS

      ALMOST ALL OF THE GRAPHS WHICH ARISE IN PRACTICE REQUIRE SOME
DRAFTING SERVICES, CONSISTING IN LABELS, AXES, AND MARKINGS OF VARIOUS
SORTS.  BECAUSE OF THEIR RELIANCE ON THE SUBROUTINES SYMBOL AND NUMBER,
WE HAVE AVOIDED ALL BUT THE BARE MINIMUM OF SUCH PROGRAMS.  THE REASON
FOR THIS AVOIDANCE HAS BEEN THE FACT THAT SYMBOL AND NUMBER ARE OUTSIDE
THE RANGE OF THE MARGIN CONTROL PROGRAMS, AND THUS THAT THEIR USAGE IS
NOT WELL INTEGRATED WITH THE REMAINDER OF OUR PROGRAMS.  FOR ARTISTIC
APPLICATIONS NO REAL PROBLEM ARISES; BUT FOR SCIENTIFIC AND TECHNICAL
DRAWINGS, THESE NOTATIONS ARE REQUIRED IN LARGE QUANTITIES.

      ORIGINALLY LIB40 CONTAINED A PROGRAM CALLED AXIS, WHICH WE HAVE
REVISED SLIGHTLY AND INCORPORATED IN THE <PLOT> FILE UNDER THE NAME
PLTAX. IT COMBINES SEVERAL OPERATIONS, NAMELY: THE DRAWING OF AN AXIS
WHOSE DIMENSIONS ARE FIXED IN INCHES, THE PLACING OF TICK MARKS WHOSE
SPACING IS ALSO DEFINED IN INCHES, RECORDING THE NUMERICAL VALUES OF
THE TICK MARKS, INSCRIBING A LABEL, AND WHERE NECESSARY WRITING OUT THE
SCALE FACTOR REQUIRED BY THE NUMERICAL VALUES.

      TO HAVE THE AXES RIGIDLY DEFINED IN INCHES IN INCONSISTENT WITH A
DESIRE TO HAVE ALL DIMENSIONS RELATIVE, AND WHEREVER POSSIBLE DEFINED
WITH RESPECT TO THE UNIT SQUARE.  THE DISADVANTAGE IS THAT SCALING THE
DRAWING DOES NOT AUTOMATICALLY SCALE THE LETTERING. RATHER,IF AN AXIS IS
SCALED WITHOUT SIMULTANEOUSLY SCALING THE SYMBOLS, THEY BECOME DISPLACED
AND MAY EVEN OVERLAP.  THESE REMAIN DIFFICULTIES TO BE RESOLVED IN THE
FUTURE; MEANWHILE PLTAX REMAINS IN THE <PLOT> FILE TO SATISFY IMMEDIATE
NECESSITIES.

      BECAUSE OF THE INCONVENIENCE TO THE USER OF CALCULATING ALL THE
ARGUMENTS OF SYMBOL OR NUMBER, PARTICULARLY THE PAGE LOCATION IN INCHES,
IT IS CONVENIENT TO HAVE SPECIAL PURPOSE SUBROUTINES AVAILABLE WHOSE
ARGUMENT IS MERELY SOME MESSAGE, WHICH IS ALWAYS PLACED IN A STANDARD
PLACE ON THE PAGE.  MOST SUBROUTINES OF THIS TYPE WILL BE WRITTEN BY THE
USER TO CONFORM TO HIS PARTICULAR PROGRAM APPLICATION, AND WOULD BE TOO
SPECIALIZED TO INCORPORATE IN THE <PLOT> FILE.  ONE, HOWEVER, PLTLA, HAS
BEEN INCLUDED TO WRITE A PROGRAM NAME OF FIVE CHARACTERS OR LESS IN THE
LOWER LEFT HAND MARGIN OF THE PAGE.  FOR REFERENCE PURPOSES IT IS OFTEN
DESIRABLE TO IDENTIFY A GRAPH BY THE PROGRAM WHICH GENERATED IT, OR TO
PLACE SOME SIMILAR LABEL ON IT.

      DRAFTING APPLICATIONS FREQUENTLY REQUIRE THE PLACEMENT OF MARKS OR
GEOMETRIC SYMBOLS AT SPECIFIED LOCATIONS ON THE PAGE.  FOR A GIVEN AREA
OF APPLICATION, IT WOULD BE SENSIBLE TO FORMULATE A REPRESENTATIVE SET
OF MARKS; FOR EXAMPLE IF THE APPLICATION WERE TO BE MAPMAKING, IT WOULD
BE ESSENTIAL TO HAVE ALL THE MAPMAKERS SYMBOLS ON HAND. 

      AT PRESENT, <PLOT> CONTAINS ONLY TWO SUCH PROGRAMS. PLTCI IS USED
TO GENERATE A CIRCLE WITH SPECIFIED CENTER AND RADIUS, WHILE PLTFM WILL
GENERATE A CROSS HAVING A GIVEN CENTER AND SIZE. SO FAR WE HAVE RESISTED
THE TEMPTATION TO GENERATE ELLIPSES, CYCLOIDS, STARS, TRIANGLES, AND SO
ON, EVEN THOUGH THE POSSIBILITY IS CLEARLY PRESENT.

      MOST PLOTTER PACKAGES CONTAIN AN AMPLE ASSORTMENT OF PROGRAMS FOR
GENERATING SPECIALIZED AXES OR PARTICULAR COORDINATE GRIDS; FOR EXAMPLE
RECTANGULAR, LOGARITHMIC, SEMILOGARITHMIC, OR NORMAL GRIDS. FRAMES CAN
EVEN BE SET UP SHOWING THE DAY AND MONTH WITHIN A YEAR.  NATURALLY, THE
PRESENCE OR LACK OF ONE OF THESE FEATURES WITHIN A PLOTTER PACKAGE WOULD
DEPEND ON THE DEMAND WHICH HAD ARISEN FOR IT. AT PRESENT <PLOT> CONTAINS
ONE PROGRAM, PLTUR, TO GENERATE A UNIT RETICLE.  PLTUR PLACES CROSSES AT
REGULAR INTERVALS IN WHATEVER COORDINATE SYSTEM THAT HAS BEEN STIPULATED
BY AN EXTERNAL ARGUMENT.

      ONE FURTHER SUBROUTINE OF THIS CATEGORY, PLTHP, IS PRESENT, WHICH
SETS UP THE RADII AND CIRCLES OF A POLAR COORDINATE SYSTEM FOR WHICH THE
RADII HAVE UNDERGONE A HYPERBOLIC TANGENT DISTORTION. NOT GENERALITY, SO
MUCH AS A FREQUENT APPLICATION, IS RESPONSIBLE FOR ITS PRESENCE.


7.  GRAPHS TAKEN FROM ARRAYS

      AMONG THE SIMPLE APPLICATIONS OF A PLOTTER PACKAGE THERE IS LIKELY
NONE WHICH HAS A GREATER DEMAND THAN THE RAPID RENDITION OF THE CONTENTS
OF AN ARRAY. THE ARRAY MAY BE A SIMPLE COLLECTION OF VALUES WHICH MAY BE
SHOWN AS A FUNCTION OF AN INTEGER VARIABLE, OR IT COULD BE MADE UP OF A
SERIES OF POINT COORDINATES, OF WHICH RECTANGULAR COORDINATES ARE AMONG
THE MOST PROBABLE.

       THE BASIC SUBROUTINE DESTINED TO MEET THESE NEEDS IS PLTIG, WHICH
PERFORMS IN AN INCREMENTAL MODE. BY MEANS OF AN ARGUMENT WHICH TAKES THE
PLACE OF MULTIPLE ENTRIES IT IS POSSIBLE TO INITIALIZE PLTIG, TO DRAW A
VISIBLE OR AN INVISIBLE LINE, GENERATE COORDINATE AXES OR TO INSERT TICK
MARKS.  BY MEANS OF AN EXTERNAL ARGUMENT WHICH SPECIFIES PEN MOVEMENT IT
IS POSSIBLE TO INTERPRET THE COORDINATES IN WHATEVER COORDINATE SYSTEM
THAT MAY BE DESIRED.  BESIDES CHOOSING BETWEEN CARTESIAN OR NONCARTESIAN
COORDINATES, IT IS POSSIBLE TO POSITION THE GRAPH ON THE PAGE AND CHANGE
ITS SCALE BY THE CHOICE OF AN ADEQUATE PEN MOVEMENT SUBROUTINE.

      WHEN THERE IS NO NEED TO STORE THE POINTS OF A CURVE, ESPECIALLY
WHEN THERE IS NO DESIRE TO DO SO (FOR EXAMPLE TO SAVE SPACE), PLTIG CAN
BE USED TO GRAPH THE CURVE IMMEDIATELY AS IT IS BEING GENERATED.

      ALTHOUGH PLTIG IS AN EXTREMELY FLEXIBLE SUBROUTINE, ITS SETUP MAY
REQUIRE MORE EFFORT THAN ONE FINDS CONVENIENT. THEN THE SUBROUTINE PLTGA
SHOULD BE USED, WHICH REQUIRES NO MORE THAN DEFINING THE VALUES OF THE
MARGINS OF THE GRAPH, STATING THE ARRAYS TO BE USED, AND SELECTING THE
PEN MOVEMENT SUBROUTINE.  FINALLY, IF ONE WISHES TO VISUALIZE AN ARRAY,
AND IS WILLING TO ACCEPT EQUAL SPACING IN THE DATA, THE SUBROUTINE PLTFI
CAN BE INVOKED.

      FOR THOSE WHOSE ONLY DESIRE IS TO USE CARTESIAN COORDINATES IN A
RAPID AND EFFECTIVE MANNER, THE PROGRAM PLTRG HAS BEEN RETAINED.


8.  COORDINATE CONVERSIONS

      THE WIDE VARIETY OF COORDINATE SYSTEMS, PAGE ARRANGEMENTS, AND
SCALING WHICH HAVE PRESENTED THEMSELVES HAVE MADE IT IMPRACTICAL TO
FOLLOW THE ORIGINAL INTENTION OF ADAPTING ALL THE SUBROUTINES TO A
STANDARD LETTER SIZED FORMAT, 8 1/2" X 11" IN EXTENT.  THE NEXT CHOICE
SEEMS TO BE TO SELECT THE UNIT SQUARE AS A STANDARD, IN SPITE OF ITS
INCOMPATIBILITY WITH THE RECTANGULAR FORM OF A SHEET OF NOTEBOOK PAPER.
EVEN THEN, THERE IS THE POSSIBILITY OF PLACING THE ORIGIN AT THE CENTER
OF THE SQUARE OR AT ITS LOWER LEFT HAND CORNER, WHICH IS THE CONVENTION
WHICH WE HAVE NOW ADOPTED.

      BECAUSE OF THE PROFUSION OF COORDINATE SYSTEMS AND MAPPINGS, A
LIST AND SHORT DESCRIPTIONN OF THEM IS GIVEN HERE.

      PLTCA MAPS THE UNIT SQUARE ONTO A HORIZONTAL LETTER SIZED PAGE.
            BECAUSE THIS PAGE IS RECTANGULAR, ITS VERTICAL SCALE IS MORE
            COMPRESSED THAN THE HORIZONTAL SCALE, FOR WHICH COMPENSATION
            HAS TO BE MADE TO GET TRUE PROPORTIONS.
      PLTLH MAPS THE UNIT SQUARE TO THE LEFT HALF OF A HORIZONTAL SHEET
      PLTRH MAPS THE UNIT SQUARE TO THE RIGHT HALF OF A HORIZONTAL SHEET
      PLTTH MAPS THE UNIT SQUARE TO THE TOP HALF OF A VERTICAL SHEET
      PLTBH MAPS THE UNIT SQUARE TO THE BOTTOM HALF OF A VERTICAL SHEET
      PLTQ1 MAPS TO THE UPPER RIGHT HAND QUADRANT OF A HORIZONTAL SHEET
      PLTQ2 MAPS TO THE UPPER LEFT HAND QUADRANT OF A HORIZONTAL SHEET
      PLTQ3 MAPS TO THE LOWER LEFT HAND QUADRANT OF A HORIZONTAL SHEET
      PLTQ4 MAPS TO THE LOWER RIGHT HAND QUADRANT OF A HORIZONTAL SHEET

      THE FOREGOING SUBROUTINES ARE ALL CONCERNED WITH PLACING A DRAWING
ON DIFFERENT PARTS OF THE PLOTTER SHEET.  IN REALITY THEY ARE ALL AFFINE
TRANSFORMATIONSOF CARTESIAN COORDINATES. HOWEVER, THERE ARE ALSO SEVERAL
SUBROUTINES THAT TRANSFORM FROM NONCARTESIAN COORDINATES TO CARTESIAN
COORDINATES,  WHICH ARE ESSENTIALLY THE COORDINATES USED BY PLTCA.

      PLTPO MAPS POLAR COORDINATES TO RECTANGULAR COORDINATES
      PLTEL MAPS ELLIPTICAL COORDINATES TO RECTANGULAR COORDINATES
      PLTSP MAPS SPHERICAL POLAR COORDINATES TO RECTANGULAR COORDINATES
      PLTTR MAPS HOMOGENEOUS COORDINATES TO RECTANGULAR COORDINATES

      UNFORTUNATELY WITH THEIR PRESENT STRUCTURE THESE MAPPINGS CANNOT
BE COMBINED, SO THAT IT IS NOT POSSIBLE TO MAKE UP A MONTAGE OF SEVERAL
DRAWINGS PRODUCED IN POLAR COORDINATES, LET US SAY, OR ELSE MADE UP FROM
VARIOUS DRAWINGS EACH ARISING FROM A DIFFERENT COORDINATE SYSTEM.
9.  CONTOUR PLOTS

      CONTOURING A FUNCTION STORED IN AN ARRAY IS BASICALLY SIMPLE, BUT
CAN BECOME COMPLICATED BY PRACTICAL CONSIDERATIONS.  ASSUMING THAT THE
ARRAY FAIRLY REPRESENTS THE FUNCTION, EITHER PATHOLOGIES TYPIFIED BY
SUCH CONFIGURATIONS AS SIN(1/X) ARE NOT PRESENT, OR IT IS ASSUMED THAT
THEY DO NOT MATTER.  GOING ONE STEP FURTHER, IT SHOULD BE ASSUMED THAT
LINEAR INTERPOLATION WOULD GIVE A SATISFACTORY CHARACTERIZATION OF THE
FUNCTION BETWEEN GRID POINTS.  IF IT IS FOUND THAT THE CONTOURS DIFFER
SIGNIFICANTLY FROM STRAIGHT LINES IN THE INTERVALS BETWEEN MESH POINTS,
EITHER THEIR ROUGH ANGULAR APPEARANCE MUST BE BORNE PHILOSOPHICALLY, THE
MESH SIZE REDUCED, OR SOME SCHEME OF INTERPOLATION USED.

      THE USE OF A MECHANICAL PLOTTER IMPOSES THE LIMITATION THAT AN
APPRECIABLE PORTION OF A CONTOUR LINE MUST BE DRAWN AT ONE TIME.  THE
REASON LIES IN THE DISCREPANCY BETWEEN THE TIMES REQUIRED TO MOVE THE
PEN LATERALLY, AND TO RAISE OR LOWER IT FROM THE SURFACE OF THE PAPER.
OTHERWISE THE ARRAY COULD BE CONTOURED ONE CELL AT A TIME, DRAWING
WHATEVER CONTOUR LINES WERE NECESSARY IN ONE CELL BEFORE MOVING ON TO
THE NEXT.  IN TURN, SOME MEANS OF MARKING CONTOUR LINES ALREADY DRAWN IS
NEEDED TO AVOID REPEATING THEM WHEN THEY ARE ENCOUNTERED SEVERAL TIMES
WHILE SCANNING THE ARRAY, OR TO AVOID GOING ROUND AND ROUND THE CLOSED
CONTOURS.

      TECHNICALLY, IT IS EASIER TO DIVIDE THE CONTOURING AREA UP INTO
TRIANGLES THAN TO DIVIDE IT INTO SQUARES, BECAUSE THERE ARE FEWER CASES
TO CONSIDER OF WHERE THE CONTOUR LINE MEETS THE BOUNDARY OF THE REGION.
FORTUNATELY, ONE SQUARE OF AN ARRAY CAN BE DIVIDED INTO TWO TRIANGLES
ALONG ONE OF ITS DIAGONALS.  THE CHOICE OF ONE OR THE OTHER DIAGONAL
IS NOT OVERLY IMPORTANT IN THE APPROXIMATION OF LINEAR INTERPOLATION,
ALTHOUGH SOME CONTOURING SCHEMES EVEN GO SO FAR AS TO MAKE FOUR LITTLE
TRIANGLES WHOSE VERTICES MEET IN THE CENTER WHERE THE DIAGONALS CROSS.

      THERE ARE TWO TECHNICAL ASPECTS OF THE CONTOURING SUBROUTINES IN
THE <PLOT> FILE WHICH MAY COMMEND THEM. BY INCORPORATING THE NAME OF THE
PEN MOVEMENT SUBROUTINE AS AN EXTERNAL VARIABLE, CONTOURING MAY BE DONE
IN ANY COORDINATE SYSTEM WHATSOEVER. SECOND, A VARIANT OF THE CONTOURING
PROGRAM WILL CONTOUR COMPLEX ARRAYS ACCORDING TO THE MAGNITUDE OF THEIR
ELEMENTS AS WELL AS ACCORDING TO THEIR PHASE.  ASIDE FROM THIS, THERE IS
AN AUTOMATIC PROVISION FOR ORTHOGRAPHIC RELIEF IN THE CONTOUR GENERATING
SUBROUTINE.

      ALTHOUGH THEY ARE NOT STRICTLY CONTOURING SUBROUTINES, THERE ARE
SOME FURTHER RELATED PROGRAMS WHICH CAN BE USED EITHER SEPARATELY OR TO
SUPPLEMENT THE CONTOURING PROGRAMS.  TWO OF THEM SIMPLY MARK AREAS OF
INTEREST, WITH HORIZONTAL OR VERTICAL LINES RESPECTIVELY.  THEY CAN ADD
SOME SHADING TO THE CONTOUR PLOT, OR BE USED SEPARATELY. ONE OF THE MORE
INTERESTING SEPARATE USES IS WITH A BROAD POINTED PEN AND COLORED INK.
IT IS A TECHNIQUE WHICH REQUIRES CARE AND ACCESS TO SUITABLE INK, BUT
ONE WHICH CAN RESULT IN TINTED MAPS, WHEREIN DIFFERENT SHADES OF COLOR
PORTRAY DIFFERENCES IN THE REGION WHICH IS REPRESENTED.


10.  HIDDEN LINE SUBROUTINES

      HIDDEN LINE PROGRAMS ARE INTENDED TO SHOW PLANAR DRAWINGS OF THREE
DIMENSIONAL OBJECTS, INCORPORATING THE ELEMENT OF REALISM THAT OPAQUE
OBJECTS HIDE ONE ANOTHER, ACCORDING TO WHICH OF THEM IS NEAREST TO THE
OBSERVER. DEPENDING UPON THE NATURE OF THE OBJECTS, HIDDEN LINE PROGRAMS
CAN BECOME QUITE COMPLICATED. EVENTUALLY ALL OF THEM REDUCE TO A SORTING
PROBLEM, ALTHOUGH SPECIAL FEATURES SOMETIMES RESULT IN SIMPLIFICATIONS.

       ONE OF THE SPECIAL CASES FOR WHICH WELL DEVELOPED TECHNIQUES
EXIST IS THE REPRESENTATION OF A SINGLE VALUED SURFACE, SUCH AS THE
GRAPH OF A MATHEMATICAL FUNCTION. ONE TREATMENT IS TO MAINTAIN A HORIZON
AND TO GRAPH THE FUNCTION LINE BY LINE, STARTING WITH THE NEAREST EDGE
OF THE SURFACE.  AS EACH NEW SEGMENT OF THE SURFACE IS ADDED, COMPARISON
IS MADE TO THE HORIZON.  THE PART OF THE FUNCTION WHICH LIES ABOVE THE
HORIZON IS ACTUALLY DRAWN, WHILE THE HORIZON IS UPDATED BY ADDING THE
VISIBLE PART OF THE FUNCTION TO IT.

      COMPLICATIONS ARISE FROM THE REPRESENTATION OF THE HORIZON. IF THE
DISTANCE BETWEEN POINTS OF DEFINITION OF THE FUNCTION IS GREAT ENOUGH,
THE HORIZON WILL PROBABLY INTERSECT IT BETWEEN THE DATA POINTS, WHICH
IMPLIES INSERTING A NEW DATA POINT IF WE INTEND TO REPRESENT THE HORIZON
ACCURATELY BY A BROKEN LINE.  THE RESULT IS A DISCREPANCY BETWEEN THE
DIMENSION OF THE ARRAY HOLDING THE HORIZON AND THE LENGTH OF THE ARRAYS
CONTAINING A LINE OF THE FUNTION.

      ALTHOUGH NONE OF THIS IS TOO DIFFICULT TO OVERCOME BY PROGRAMMING,
THERE ARE DIFFERENT TECHNIQUES WHICH MIGHT BE USED, WHICH IMPLIES AN
EVALUATION OF THEIR EFFICIENCIES AND A DECISION OF WHICH OF THEM TO USE.
MORE HAS TO BE TAKEN INTO ACCOUNT THAN THE MERE CALCULATION OF AN UPPER
BOUND.  FOR EXAMPLE, PEN MOTION IN BOTH DIRECTIONS NEEDS TO BE USED IN
A MECHANICAL PLOTTER. THIS IN TURN LEADS TO A DECISION AS TO WHETHER TO
MOVE THE PEN IMMEDIATELY, OR TO STORE THE INCREMENTS FOR LATER DECISIONS
ABOUT THE DIRECTION OF PEN MOVEMENT. WHEN A DRAWING IN SEVERAL COLORS IS
PLANNED, THESE DECISIONS AND THEIR INTERACTIONS BECOME MORE ACUTE. 

      THE PRINCIPAL PROGRAM FOR CALCULATING THE UPPER AND LOWER BOUNDS
IS VISHO.  IT IS THE OUTGROWTH, AFTER CONSIDERABLE COMPACTIFICATION AND
REVISION, ADAPTATION FOR BOTH DIRECTIONS OF PEN MOTION, AND SELECTIVE
LOWERING OF THE PEN, OF AN ALGORITHM PUBLISHED IN THE COMMUNICATIONS OF
THE ASSOCIATION FOR COMPUTING MACHINERY IN 1972 BY HUGH WILLIAMSON.

      THE KEY TO THE USE OF ARBITRARY COORDINATE SYSTEMS FOR DEFINING A
SURFACE IS TO HAVE A GENERAL PURPOSE SEARCH ROUTINE.  THE ORIGINALLY
PUBLISHED ALGORITHMS ALL USED A SEARCH PARALLEL TO ONE OF THE COORDINATE
AXES, WITH THE RESULT THAT ARCS OF ONLY ONE COORDINATE WERE DRAWN ON THE
SURFACE.  BOTH N.Y. GRAHAM AND THOMAS J. WRIGHT SUGGESTED A METHOD FOR
USING ARCS PARALLEL TO BOTH COORDINATE AXES, BUT IT IS NOT CLEAR FROM
THEIR ARTICLES WHETHER THEY ACTUALLY IMPLEMENTED THEIR ALGORITHMS IN THE
FORM DESCRIBED.  HOWEVER, THE SUGGESTIONS WERE VALID, AND FORMED THE
BASIS OF VISDS, AS WELL AS MANY OF ITS VARIANTS DESIGNED FOR SEVERAL
OTHER COORDINATE SYSTEMS.


11.  MULTIPLE SURFACES

      A NATURAL EXTENSION OF THE ALGORITHMS TO GRAPH SINGLE SURFACES
WOULD BE TO GRAPH MULTIPLE SURFACES.  ALL THAT IS REALLY INVOLVED IS TO
CALCULATE ENOUGH UPPER AND LOWER BOUNDS THAT ONE HAS THE FUNCTION VALUES
IN INCREASING ORDER RATHER THAN ACCORDING TO THE FUNCTION TO WHICH THEY
HAPPEN TO BELONG.  HERE THE SAME DILEMMA PRESENTS ITSELF THAT ARISES FOR
SIMPLE SURFACES.  GIVEN ENOUGH MEMORY, AND THE DESIRE TO CALCULATE THE
FUNCTIONS ON A FINE ENOUGH SCALE, A COMMON GRID CAN BE USED FOR HORIZONS
AS WELL AS FOR THE FUNCTIONS, AND THE WHOLE COMPARISON CAN BE DONE USING
AMIN1 AND AMAX1, WITH CONSIDERABLE SAVING IN LINEAR INTERPOLATION AND
WITHOUT HAVING TO BOTHER WITH AUXILIARY ARRAYS OF DIFFERENT AND VARIABLE
DIMENSION.

      IN THE CONTRARY CASE, VISBO CAN BE USED TO CALCULATE THE BOUNDS,
BUT THERE IS CONSIDERABLE PRELIMINARY CALCULATION NEEDED BEFORE THE
ACTUAL PEN MOVEMENTS ARE REQUIRED.  FOR THIS REASON, AND BECAUSE BOTH
BOUNDS ARE NOT NEEDED AT ONCE, VISRB WAS INTRODUCED. IT IS USED IN PLACE
OF VISBO BY THE MULTIPLE SURFACE ROUTINES.

      THE MULTIPLE SURFACE ROUTINES PERMIT AN OPTION OF DRAWING THE
DIFFERENT SURFACES EXACTLY AS THEY ARE RELATED TO ONE ANOTHER, OR OF
DISPLACING THEM VERTICALLY SO THAT THE DETAILS OF THEIR INTERSECTIONS
BECOME MUCH CLEARER.

      THE TWO ROUTINES PRESENTLY AVAILABLE, BOTH OF WHICH REQUIRE
CARTESIAN COORDINATES, ARE:

      VISDO   DOUBLE SURFACES
      VISTR   TRIPLE SURFACES.

AMONG THE DEMONSTRATIONS, PARTICULARLY THE SEQUENCE RUNNING FROM DEM13
TO DEM23, CAN BE FOUND SOME MULTIPLE SURFACE ROUTINES FOR SPHERICAL
COORDINATES.


12.  COLOR COMPOSITES

      IT HAS BEEN SAID THAT THE USE OF COLOR ADDS A WHOLE NEW DIMENSION
TO GRAPHICS.  EVEN THOUGH IT IS NOT POSSIBLE TO PUBLISH THE RESULTS IN
BLACK AND WHITE JOURNALS, IT IS UNDENIABLE THAT COLOR VASTLY ENHANCES
THE QUALITY OF SURFACE DRAWINGS, AND MOST PROBABLE THAT CONTOUR PLOTS
IMPROVE THEIR UNDERSTANDABILITY FOR BEING IN COLOR AS WELL. IN THE FACE
OF SUCH POTENTIAL BENEFITS, THE ONLY IMPORTANT QUESTION TO BE ASKED IS:
WHAT IS THE COST?

      THE CALCOMP MODEL 565 PLOTTER HAS BUT ONE PEN HOLDER, BUT THERE
ARE SEVERAL DIFFERENT COLORS OF INK AVAILABLE FOR THE PENS THEMSELVES.
GIVEN ACCESS TO A FLUID PEN, THE VARIETY IS LIMITED ONLY BY THE INKS
WHICH CAN BE BOUGHT OR SOMEHOW MIXED UP, ACCORDING TO THE INK MARKET.
IT IS MOSTLY A QUESTION OF OPERATOR CONVENIENCE, AND SOME ACROBATICS, TO
CHANGE THE PEN BETWEEN MULTIPLE RUNS OF THE PLOTTER. MORE RECENT PLOTTER
MODELS EVEN HAVE MULTIPLE PEN HOLDERS, AND ALLOW A CHANGE OF PENS TO BE
PROGRAMMED.  THEREFORE MULTIPLE COLOR IS AVAILABLE WITH VARYING DEGREES
OF INCONVENIENCE ON ANY PLOTTER THAT HAS EVEN ONE COLOR.  REGRETTABLY
ELECTROSTATIC OR MICROFILM PLOTTERS DO NOT MANIFEST THE SAME INTRINSIC
VERSATILITY.

     GRANTED THAT THE EQUIPMENT IS AVAILABLE, THERE IS THE COST OF
OPERATING THE PLOTTER.  EXPERIENCE SHOWS THAT PLOTTER RUNNING TIME IS
MULTIPLIED BY THE NUMBER OF COLORS, APPROXIMATELY.  THE REASON IS THAT
WHEN THE COLORS ARE WELL MIXED, IT TAKES ABOUT THE SAME TIME TO PASS
OVER A BLANK AREA AS TO MARK IT; IT IS PROBABLY PREFERABLE TO AVOID PEN
CHANGES JUST AS MUCH AS IT IS DESIRABLE TO AVOID EXCESSIVE PEN RAISING
AND LOWERING.  ULTIMATELY SUCH A COMPARISON WOULD HAVE TO BE MADE ON A
MULTIPLE PEN PLOTTER.  HOWEVER, INCREASED PLOTTER TIME IS NOT LIKELY TO
BE AN OBSTACLE IN COMPARISON TO THE COMPUTER TIME USED TO GENERATE THE
DRAWING.

      UNFORTUNATELY, THE PRESENT CONSTRUCTION OF PROGRAMS SUCH AS VISBO
MULTIPLIES THE COMPUTER TIME BY THE NUMBER OF COLORS ALSO, REQUIRING A
SEPARATE PASS FOR EACH COLOR. THIS IS NOT AN INTRINSIC DRAWBACK BUT WILL
REQUIRE SOME REPROGRAMMING TO MODIFY THE TREATMENT OF COLORS.  THEREFORE
THE FINAL COST ITEM IS THE REPROGRAMMING COST. IT WILL NOT BE GREAT, BUT
WILL NOT BE AVAILABLE IN TIME FOR THE CLOSE OF THE 1974-1975 PROGRAMMING
SEASON.

      NEVERTHELESS, THE EXPECTATION IS INESCAPABLE THAT BICHROMATIC
DRAWINGS WILL BE AVAILABLE FOR AN INCONSEQUENTIALLY HIGHER COST THAN
MONOCHROMATIC DRAWINGS, AND THAT POLYCHROMATIC DRAWINGS WILL COST BUT
SLIGHTLY MORE.  EVEN FOR SITUATIONS, SUCH AS JOURNAL PUBLICATION, WHICH
WILL NOT PERMIT THE USE OF COLOR, THERE ARE OTHER ALTERNATIVES.  FOR
EXAMPLE, DIFFERENT LINE WIDTHS MAY BE USED TO CREATE DIFFERENCES IN
TEXTURE.

BIBLIOGRAPHY

1.  N. Y. GRAHAM, PERSPECTIVE DRAWING OF SURFACES WITH HIDDEN LINE
       ELIMINATION, BELL SYSTEM TECHNICAL JOURNAL 51 843-861 (1972)

2.  THOMAS K. PEUCKER, COMPUTER CARTOGRAPHY, COMMISSION ON COLLEGE
       CARTOGRAPHY RESOURCE PAPER NO. 17, ASSOCIATION OF AMERICAN
       GEOGRAPHERS, WASHINGTON, D.C., 1972

3.  STEVEN L. WATKINS, ALGORITHM 483: MASKED THREE-DIMENSIONAL PLOT
       PROGRAM WITH ROTATIONS, COMMUNICATIONS OF THE ASSOCIATION FOR
       COMPUTING MACHINERY 17 520-523 (1974)

4.  HUGH WILLIAMSON, ALGORITHM 420: HIDDEN LINE PLOTTING PROGRAM,
       COMMUNICATIONS OF THE ASSOCIATION FOR COMPUTING MACHINERY
       15 100-103 (1972)

5.  THOMAS J. WRIGHT, A TWO-SPACE SOLUTION TO THE HIDDEN LINE PROBLEM
       FOR PLOTTING FUNCTIONS OF TWO VARIABLES, IEEE TRANSACTIONS ON
       COMPUTERS C22 28-33 (1973)

6.  THOMAS WRIGHT, ALGORITHM 475: VISIBLE SURFACE PLOTTING PROGRAM,
       COMMUNICATIONS OF THE ASSOCIATION FOR COMPUTING MACHINERY 17
       152-155 (1974)

[24-MAY-75]

APPENDIX 1.  INDEX OF THE <PLOT> FILE.

      FUNCTION    CARG (Z)

      SUBROUTINE  KONIT (I,J,K)

      SUBROUTINE  KONNC

      SUBROUTINE  KONRE

      SUBROUTINE  KONSA

      SUBROUTINE  KONSC (Z0,XF,YF,IA,IB,JA,JB,ZE,NX,NY,PL)

      SUBROUTINE  KONSK (Z0,IA,IB,JA,JB,ZE,NX,NY,FU,PL)

      SUBROUTINE  KONXV (I,J)

      SUBROUTINE  PLT00

      SUBROUTINE  PLTAX (X,Y,HE,NC,SZ,TH,V0,DV,L)

      SUBROUTINE  PLTBH (X,Y,P)

      SUBROUTINE  PLTBO

      SUBROUTINE  PLTBS

      SUBROUTINE  PLTBV (Z1,ZE,Z2,NX,NY,PL)

      SUBROUTINE  PLTCA (X,Y,P)

      SUBROUTINE  PLTCI (X,Y,R,PL)

      SUBROUTINE  PLTEJ

      SUBROUTINE  PLTEL (XI,ETA,P)

      SUBROUTINE  PLTEU (O,E1,E2,E3)

      SUBROUTINE  PLTEV (Z1,ZE,Z2,NX,NE,PL)

      SUBROUTINE  PLTFI (Y1,WY,Y2,N,PL)

      SUBROUTINE  PLTFM (X,Y,R,PL)

      SUBROUTINE  PLTFR

      SUBROUTINE  PLTGA (X1,X,X2,Y1,Y,Y2,N,PL)

      SUBROUTINE  PLTHP (NR,NT,PL)

      SUBROUTINE  PLTIG (X,Y,L,PL)

      SUBROUTINE  PLTIL (X1,Y1,Z1,X2,Y2,Z2,PL)

      SUBROUTINE  PLTIV (Z1,ZE,Z2,NX,NY,RO,TI,PL)

      SUBROUTINE  PLTKB (Z1,ZE,Z2,NZ,NX,NY,PL)

