
(/VERSIONCHECK 2) 

(DEFUN |PLOTTOOL;drawToScaleRanges| (|xVals| |yVals| $)
  (PROG (|pad| |yDiff| |yLo| |yHi| |xDiff| |xLo| |xHi|)
    (RETURN
     (SEQ
      (LETT |xDiff|
            (-
             (LETT |xHi| (SPADCALL |xVals| (QREFELT $ 8))
                   . #1=(|PLOTTOOL;drawToScaleRanges|))
             (LETT |xLo| (SPADCALL |xVals| (QREFELT $ 9)) . #1#))
            . #1#)
      (LETT |yDiff|
            (- (LETT |yHi| (SPADCALL |yVals| (QREFELT $ 8)) . #1#)
               (LETT |yLo| (SPADCALL |yVals| (QREFELT $ 9)) . #1#))
            . #1#)
      (LETT |pad| (/ (FLOAT-SIGN 1.0 (- |yDiff| |xDiff|)) 2) . #1#)
      (EXIT
       (COND
        ((< |xDiff| |yDiff|)
         (LIST (SPADCALL (- |xLo| |pad|) (+ |xHi| |pad|) (QREFELT $ 10))
               |yVals|))
        ('T
         (LIST |xVals|
               (SPADCALL (- |yLo| |pad|) (+ |yHi| |pad|) (QREFELT $ 10)))))))))) 

(DEFUN |PLOTTOOL;select| (|l| |f| |g| $)
  (PROG (|m| #1=#:G667 |p|)
    (RETURN
     (SEQ (LETT |m| (SPADCALL (|SPADfirst| |l|) |f|) . #2=(|PLOTTOOL;select|))
          (SEQ (LETT |p| NIL . #2#) (LETT #1# (CDR |l|) . #2#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |p| (CAR #1#) . #2#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT (LETT |m| (SPADCALL |m| (SPADCALL |p| |f|) |g|) . #2#)))
               (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |m|))))) 

(DEFUN |PLOTTOOL;xRange0| (|list| $)
  (SPADCALL (|PLOTTOOL;select| |list| (ELT $ 13) (ELT $ 14) $)
            (|PLOTTOOL;select| |list| (ELT $ 13) (ELT $ 15) $) (QREFELT $ 16))) 

(DEFUN |PLOTTOOL;yRange0| (|list| $)
  (SPADCALL (|PLOTTOOL;select| |list| (ELT $ 17) (ELT $ 14) $)
            (|PLOTTOOL;select| |list| (ELT $ 17) (ELT $ 15) $) (QREFELT $ 16))) 

(DEFUN |PLOTTOOL;select2| (|l| |f| |g| $)
  (PROG (|m| #1=#:G673 |p|)
    (RETURN
     (SEQ (LETT |m| (SPADCALL (|SPADfirst| |l|) |f|) . #2=(|PLOTTOOL;select2|))
          (SEQ (LETT |p| NIL . #2#) (LETT #1# (CDR |l|) . #2#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |p| (CAR #1#) . #2#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT (LETT |m| (SPADCALL |m| (SPADCALL |p| |f|) |g|) . #2#)))
               (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |m|))))) 

(DEFUN |PLOTTOOL;xRange| (|list| $)
  (SPADCALL
   (|PLOTTOOL;select2| |list| (CONS #'|PLOTTOOL;xRange!0| $) (ELT $ 14) $)
   (|PLOTTOOL;select2| |list| (CONS #'|PLOTTOOL;xRange!1| $) (ELT $ 15) $)
   (QREFELT $ 16))) 

(DEFUN |PLOTTOOL;xRange!1| (|v1| $)
  (SPADCALL (|PLOTTOOL;xRange0| |v1| $) (QREFELT $ 8))) 

(DEFUN |PLOTTOOL;xRange!0| (|u1| $)
  (SPADCALL (|PLOTTOOL;xRange0| |u1| $) (QREFELT $ 9))) 

(DEFUN |PLOTTOOL;yRange| (|list| $)
  (SPADCALL
   (|PLOTTOOL;select2| |list| (CONS #'|PLOTTOOL;yRange!0| $) (ELT $ 14) $)
   (|PLOTTOOL;select2| |list| (CONS #'|PLOTTOOL;yRange!1| $) (ELT $ 15) $)
   (QREFELT $ 16))) 

(DEFUN |PLOTTOOL;yRange!1| (|v1| $)
  (SPADCALL (|PLOTTOOL;yRange0| |v1| $) (QREFELT $ 8))) 

(DEFUN |PLOTTOOL;yRange!0| (|u1| $)
  (SPADCALL (|PLOTTOOL;yRange0| |u1| $) (QREFELT $ 9))) 

(DEFUN |PLOTTOOL;calcRanges;LL;8| (|llp| $)
  (COND
   ((SPADCALL (QREFELT $ 20))
    (|PLOTTOOL;drawToScaleRanges| (|PLOTTOOL;xRange| |llp| $)
     (|PLOTTOOL;yRange| |llp| $) $))
   ('T (LIST (|PLOTTOOL;xRange| |llp| $) (|PLOTTOOL;yRange| |llp| $))))) 

(DEFUN |PlotTools| #1=()
  (PROG #1#
    (RETURN
     (PROG (#2=#:G678)
       (RETURN
        (COND
         ((LETT #2# (HGET |$ConstructorCache| '|PlotTools|) . #3=(|PlotTools|))
          (|CDRwithIncrement| (CDAR #2#)))
         ('T
          (UNWIND-PROTECT
              (PROG1
                  (CDDAR
                   (HPUT |$ConstructorCache| '|PlotTools|
                         (LIST (CONS NIL (CONS 1 (|PlotTools;|))))))
                (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|PlotTools|))))))))))) 

(DEFUN |PlotTools;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
     (PROGN
      (LETT |dv$| '(|PlotTools|) . #1=(|PlotTools|))
      (LETT $ (GETREFV 24) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|PlotTools| NIL (CONS 1 $))
      (|stuffDomainSlots| $)
      $)))) 

(MAKEPROP '|PlotTools| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|DoubleFloat|) (|Segment| 6) (0 . |hi|)
              (5 . |lo|) (10 . |segment|) (|Point| 6) (|PointPackage| 6)
              (16 . |xCoord|) (21 . |min|) (27 . |max|) (33 . SEGMENT)
              (39 . |yCoord|) (|Boolean|) (|GraphicsDefaults|)
              (44 . |drawToScale|) (|List| 7) (|List| (|List| 11))
              |PLOTTOOL;calcRanges;LL;8|)
           '#(|calcRanges| 48) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 23
                                                 '(1 7 6 0 8 1 7 6 0 9 2 7 0 6
                                                   6 10 1 12 6 11 13 2 6 0 0 0
                                                   14 2 6 0 0 0 15 2 7 0 6 6 16
                                                   1 12 6 11 17 0 19 18 20 1 0
                                                   21 22 23)))))
           '|lookupComplete|)) 

(MAKEPROP '|PlotTools| 'NILADIC T) 
