
(/VERSIONCHECK 2) 

(DEFUN |TUBETOOL;point;4DfP;1| (|x| |y| |z| |c| $)
  (PROG (|l|)
    (RETURN
     (SPADCALL (LETT |l| (LIST |x| |y| |z| |c|) |TUBETOOL;point;4DfP;1|)
               (QREFELT $ 8))))) 

(DEFUN |TUBETOOL;getColor| (|pt| $)
  (COND ((< 3 (SPADCALL |pt| (QREFELT $ 12))) (SPADCALL |pt| (QREFELT $ 14)))
        ('T 0.0))) 

(DEFUN |TUBETOOL;getColor2| (|p0| |p1| $)
  (COND ((< 3 (SPADCALL |p0| (QREFELT $ 12))) (SPADCALL |p0| (QREFELT $ 14)))
        ((< 3 (SPADCALL |p1| (QREFELT $ 12))) (SPADCALL |p1| (QREFELT $ 14)))
        ('T 0.0))) 

(DEFUN |TUBETOOL;*;Df2P;4| (|a| |p| $)
  (PROG (|l|)
    (RETURN
     (SEQ
      (LETT |l|
            (LIST (* |a| (SPADCALL |p| (QREFELT $ 15)))
                  (* |a| (SPADCALL |p| (QREFELT $ 16)))
                  (* |a| (SPADCALL |p| (QREFELT $ 17)))
                  (|TUBETOOL;getColor| |p| $))
            |TUBETOOL;*;Df2P;4|)
      (EXIT (SPADCALL |l| (QREFELT $ 8))))))) 

(DEFUN |TUBETOOL;+;3P;5| (|p0| |p1| $)
  (PROG (|l|)
    (RETURN
     (SEQ
      (LETT |l|
            (LIST
             (+ (SPADCALL |p0| (QREFELT $ 15)) (SPADCALL |p1| (QREFELT $ 15)))
             (+ (SPADCALL |p0| (QREFELT $ 16)) (SPADCALL |p1| (QREFELT $ 16)))
             (+ (SPADCALL |p0| (QREFELT $ 17)) (SPADCALL |p1| (QREFELT $ 17)))
             (|TUBETOOL;getColor2| |p0| |p1| $))
            |TUBETOOL;+;3P;5|)
      (EXIT (SPADCALL |l| (QREFELT $ 8))))))) 

(DEFUN |TUBETOOL;-;3P;6| (|p0| |p1| $)
  (PROG (|l|)
    (RETURN
     (SEQ
      (LETT |l|
            (LIST
             (- (SPADCALL |p0| (QREFELT $ 15)) (SPADCALL |p1| (QREFELT $ 15)))
             (- (SPADCALL |p0| (QREFELT $ 16)) (SPADCALL |p1| (QREFELT $ 16)))
             (- (SPADCALL |p0| (QREFELT $ 17)) (SPADCALL |p1| (QREFELT $ 17)))
             (|TUBETOOL;getColor2| |p0| |p1| $))
            |TUBETOOL;-;3P;6|)
      (EXIT (SPADCALL |l| (QREFELT $ 8))))))) 

(DEFUN |TUBETOOL;dot;2PDf;7| (|p0| |p1| $)
  (+
   (+ (* (SPADCALL |p0| (QREFELT $ 15)) (SPADCALL |p1| (QREFELT $ 15)))
      (* (SPADCALL |p0| (QREFELT $ 16)) (SPADCALL |p1| (QREFELT $ 16))))
   (* (SPADCALL |p0| (QREFELT $ 17)) (SPADCALL |p1| (QREFELT $ 17))))) 

(DEFUN |TUBETOOL;cross;3P;8| (|p0| |p1| $)
  (PROG (|l| |z1| |y1| |x1| |z0| |y0| |x0|)
    (RETURN
     (SEQ
      (LETT |x0| (SPADCALL |p0| (QREFELT $ 15)) . #1=(|TUBETOOL;cross;3P;8|))
      (LETT |y0| (SPADCALL |p0| (QREFELT $ 16)) . #1#)
      (LETT |z0| (SPADCALL |p0| (QREFELT $ 17)) . #1#)
      (LETT |x1| (SPADCALL |p1| (QREFELT $ 15)) . #1#)
      (LETT |y1| (SPADCALL |p1| (QREFELT $ 16)) . #1#)
      (LETT |z1| (SPADCALL |p1| (QREFELT $ 17)) . #1#)
      (LETT |l|
            (LIST (- (* |y0| |z1|) (* |y1| |z0|))
                  (- (* |z0| |x1|) (* |z1| |x0|))
                  (- (* |x0| |y1|) (* |x1| |y0|))
                  (|TUBETOOL;getColor2| |p0| |p1| $))
            . #1#)
      (EXIT (SPADCALL |l| (QREFELT $ 8))))))) 

(DEFUN |TUBETOOL;unitVector;2P;9| (|p| $)
  (SPADCALL
   (SPADCALL (SPADCALL (SPADCALL |p| |p| (QREFELT $ 21)) (QREFELT $ 23))
             (QREFELT $ 24))
   |p| (QREFELT $ 18))) 

(DEFUN |TUBETOOL;cosSinInfo;IL;10| (|n| $)
  (PROG (|ans| |angle| #1=#:G685 |i| |theta|)
    (RETURN
     (SEQ (LETT |ans| NIL . #2=(|TUBETOOL;cosSinInfo;IL;10|))
          (LETT |theta|
                (/
                 (SPADCALL 2 (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT)
                           (QREFELT $ 27))
                 |n|)
                . #2#)
          (SEQ (LETT |i| 1 . #2#) (LETT #1# (- |n| 1) . #2#) G190
               (COND ((QSGREATERP |i| #1#) (GO G191)))
               (SEQ (LETT |angle| (SPADCALL |i| |theta| (QREFELT $ 29)) . #2#)
                    (EXIT
                     (LETT |ans|
                           (CONS (LIST (COS |angle|) (SIN |angle|)) |ans|)
                           . #2#)))
               (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |ans|))))) 

(DEFUN |TUBETOOL;loopPoints;3PDfLL;11| (|ctr| |pNorm| |bNorm| |rad| |cosSin| $)
  (PROG (|pt| |ans| |sin| |cos| |cossin|)
    (RETURN
     (SEQ (LETT |ans| NIL . #1=(|TUBETOOL;loopPoints;3PDfLL;11|))
          (SEQ G190
               (COND ((NULL (COND ((NULL |cosSin|) 'NIL) ('T 'T))) (GO G191)))
               (SEQ (LETT |cossin| (|SPADfirst| |cosSin|) . #1#)
                    (LETT |cos| (|SPADfirst| |cossin|) . #1#)
                    (LETT |sin| (SPADCALL |cossin| (QREFELT $ 32)) . #1#)
                    (LETT |ans|
                          (CONS
                           (SPADCALL |ctr|
                                     (SPADCALL |rad|
                                               (SPADCALL
                                                (SPADCALL |cos| |pNorm|
                                                          (QREFELT $ 18))
                                                (SPADCALL |sin| |bNorm|
                                                          (QREFELT $ 18))
                                                (QREFELT $ 19))
                                               (QREFELT $ 18))
                                     (QREFELT $ 19))
                           |ans|)
                          . #1#)
                    (EXIT (LETT |cosSin| (CDR |cosSin|) . #1#)))
               NIL (GO G190) G191 (EXIT NIL))
          (LETT |pt|
                (SPADCALL |ctr| (SPADCALL |rad| |pNorm| (QREFELT $ 18))
                          (QREFELT $ 19))
                . #1#)
          (EXIT (CONS |pt| (SPADCALL |ans| |pt| (QREFELT $ 34)))))))) 

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

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

(MAKEPROP '|TubePlotTools| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|List| 9) (|Point| 9) (0 . |point|)
              (|DoubleFloat|) |TUBETOOL;point;4DfP;1| (|Integer|)
              (5 . |maxIndex|) (|PointPackage| 9) (10 . |color|)
              (15 . |xCoord|) (20 . |yCoord|) (25 . |zCoord|)
              |TUBETOOL;*;Df2P;4| |TUBETOOL;+;3P;5| |TUBETOOL;-;3P;6|
              |TUBETOOL;dot;2PDf;7| |TUBETOOL;cross;3P;8| (30 . |sqrt|)
              (35 . |inv|) |TUBETOOL;unitVector;2P;9| (|PositiveInteger|)
              (40 . *) (|NonNegativeInteger|) (46 . *) (|List| 6)
              |TUBETOOL;cosSinInfo;IL;10| (52 . |second|) (|List| 7)
              (57 . |concat|) |TUBETOOL;loopPoints;3PDfLL;11|)
           '#(|unitVector| 63 |point| 68 |loopPoints| 76 |dot| 85 |cross| 91
              |cosSinInfo| 97 - 102 + 108 * 114)
           'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 35
                                                 '(1 7 0 6 8 1 7 11 0 12 1 13 9
                                                   7 14 1 13 9 7 15 1 13 9 7 16
                                                   1 13 9 7 17 1 9 0 0 23 1 9 0
                                                   0 24 2 9 0 26 0 27 2 9 0 28
                                                   0 29 1 6 9 0 32 2 33 0 0 7
                                                   34 1 0 7 7 25 4 0 7 9 9 9 9
                                                   10 5 0 33 7 7 7 9 30 35 2 0
                                                   9 7 7 21 2 0 7 7 7 22 1 0 30
                                                   11 31 2 0 7 7 7 20 2 0 7 7 7
                                                   19 2 0 7 9 7 18)))))
           '|lookupComplete|)) 

(MAKEPROP '|TubePlotTools| 'NILADIC T) 
