
(/VERSIONCHECK 2) 

(DEFUN |PLOTTOOL;drawToScaleRanges| (|xVals| |yVals| $)
  (PROG (|xHi| |xLo| |xDiff| |yHi| |yLo| |yDiff| |pad|)
    (RETURN
      (SEQ (LETT |xDiff|
                 (- (LETT |xHi| (SPADCALL |xVals| (QREFELT $ 8))
                          . #0=(|PLOTTOOL;drawToScaleRanges|))
                    (LETT |xLo| (SPADCALL |xVals| (QREFELT $ 9)) . #0#)) . #0#)
           (LETT |yDiff|
                 (- (LETT |yHi| (SPADCALL |yVals| (QREFELT $ 8)) . #0#)
                    (LETT |yLo| (SPADCALL |yVals| (QREFELT $ 9)) . #0#)) . #0#)
           (LETT |pad|
                 (/ (FLOAT-SIGN 1.0 (- |yDiff| |xDiff|)) 2) . #0#)
           (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 (|p| #0=#:G1821 |m|)
    (RETURN
      (SEQ (LETT |m| (SPADCALL (|SPADfirst| |l|) |f|)
                 . #1=(|PLOTTOOL;select|))
           (SEQ (LETT |p| NIL . #1#) (LETT #0# (CDR |l|) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |p| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (LETT |m|
                                 (SPADCALL |m| (SPADCALL |p| |f|) |g|) . #1#)))
                (LETT #0# (CDR #0#) . #1#) (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 (|p| #0=#:G1827 |m|)
    (RETURN
      (SEQ (LETT |m| (SPADCALL (|SPADfirst| |l|) |f|)
                 . #1=(|PLOTTOOL;select2|))
           (SEQ (LETT |p| NIL . #1#) (LETT #0# (CDR |l|) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |p| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (LETT |m|
                                 (SPADCALL |m| (SPADCALL |p| |f|) |g|) . #1#)))
                (LETT #0# (CDR #0#) . #1#) (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| (|#1| $)
  (SPADCALL (|PLOTTOOL;xRange0| |#1| $) (QREFELT $ 8))) 

(DEFUN |PLOTTOOL;xRange!0| (|#1| $)
  (SPADCALL (|PLOTTOOL;xRange0| |#1| $) (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| (|#1| $)
  (SPADCALL (|PLOTTOOL;yRange0| |#1| $) (QREFELT $ 8))) 

(DEFUN |PLOTTOOL;yRange!0| (|#1| $)
  (SPADCALL (|PLOTTOOL;yRange0| |#1| $) (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| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1832)
        (RETURN
          (COND
            ((LETT #0# (HGET |$ConstructorCache| '|PlotTools|)
                   . #1=(|PlotTools|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache| '|PlotTools|
                                   (LIST
                                    (CONS NIL (CONS 1 (|PlotTools;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#) (HREM |$ConstructorCache| '|PlotTools|))))))))))) 

(DEFUN |PlotTools;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|PlotTools|) . #0=(|PlotTools|))
        (LETT $ (GETREFV 24) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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) 
