
(/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 (|x0| |y0| |z0| |x1| |y1| |z1| |l|)
    (RETURN
      (SEQ (LETT |x0| (SPADCALL |p0| (QREFELT $ 15))
                 . #0=(|TUBETOOL;cross;3P;8|))
           (LETT |y0| (SPADCALL |p0| (QREFELT $ 16)) . #0#)
           (LETT |z0| (SPADCALL |p0| (QREFELT $ 17)) . #0#)
           (LETT |x1| (SPADCALL |p1| (QREFELT $ 15)) . #0#)
           (LETT |y1| (SPADCALL |p1| (QREFELT $ 16)) . #0#)
           (LETT |z1| (SPADCALL |p1| (QREFELT $ 17)) . #0#)
           (LETT |l|
                 (LIST (- (* |y0| |z1|) (* |y1| |z0|))
                       (- (* |z0| |x1|) (* |z1| |x0|))
                       (- (* |x0| |y1|) (* |x1| |y0|))
                       (|TUBETOOL;getColor2| |p0| |p1| $)) . #0#)
           (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 (|theta| |i| #0=#:G1839 |angle| |ans|)
    (RETURN
      (SEQ (LETT |ans| NIL . #1=(|TUBETOOL;cosSinInfo;IL;10|))
           (LETT |theta|
                 (/ (SPADCALL 2 (FLOAT PI MOST-POSITIVE-DOUBLE-FLOAT)
                        (QREFELT $ 27))
                    |n|) . #1#)
           (SEQ (LETT |i| 1 . #1#) (LETT #0# (- |n| 1) . #1#) G190
                (COND ((QSGREATERP |i| #0#) (GO G191)))
                (SEQ (LETT |angle|
                           (SPADCALL |i| |theta| (QREFELT $ 29)) . #1#)
                     (EXIT (LETT |ans|
                                 (CONS (LIST (COS |angle|)
                                        (SIN |angle|))
                                       |ans|) . #1#)))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (EXIT |ans|))))) 

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

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

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