
(/VERSIONCHECK 2) 

(DEFUN |EXPRTUBE;getVariable| (|x| |y| |z| $)
  (PROG (|varList1| |varList2| |varList3| #0=#:G1825 |t1| |t2|)
    (RETURN
      (SEQ (LETT |varList1| (SPADCALL |x| (QREFELT $ 8))
                 . #1=(|EXPRTUBE;getVariable|))
           (LETT |varList2| (SPADCALL |y| (QREFELT $ 8)) . #1#)
           (LETT |varList3| (SPADCALL |z| (QREFELT $ 8)) . #1#)
           (COND
             ((OR (< 1 (LENGTH |varList1|))
                  (OR (< 1 (LENGTH |varList2|))
                      (< 1 (LENGTH |varList3|))))
              (EXIT (|error| "tubePlot: only one variable may be used"))))
           (EXIT (COND
                   ((NULL |varList1|)
                    (COND
                      ((NULL |varList2|)
                       (COND
                         ((NULL |varList3|)
                          (|error| "tubePlot: a variable must appear in functions"))
                         (#2='T (|SPADfirst| |varList3|))))
                      (#2#
                       (SEQ (LETT |t2| (|SPADfirst| |varList2|) . #1#)
                            (EXIT (COND
                                    ((NULL |varList3|) |t2|)
                                    (#2#
                                     (SEQ
                                      (EXIT
                                       (COND
                                         ((NULL
                                           (EQUAL
                                            (|SPADfirst| |varList3|)
                                            |t2|))
                                          (PROGN
                                            (LETT #0#
                                             (|error|
                                              "tubePlot: only one variable may be used") . #1#)
                                            (GO #0#)))))
                                      #0# (EXIT #0#)))))))))
                   (#2#
                    (SEQ (LETT |t1| (|SPADfirst| |varList1|) . #1#)
                         (EXIT (COND
                                 ((NULL |varList2|)
                                  (COND
                                    ((OR (NULL |varList3|)
                                      (NULL
                                       (NULL
                                        (EQUAL (|SPADfirst| |varList3|)
                                         |t1|))))
                                     |t1|)
                                    ('T
                                     (|error|
                                      "tubePlot: only one variable may be used"))))
                                 (#2#
                                  (SEQ (LETT |t2|
                                        (|SPADfirst| |varList2|) . #1#)
                                       (EXIT
                                        (COND
                                          ((NULL |varList3|)
                                           (COND
                                             ((EQUAL |t1| |t2|) |t1|)
                                             (#2#
                                              (|error|
                                               "tubePlot: only one variable may be used"))))
                                          (#2#
                                           (SEQ
                                            (COND
                                              ((EQUAL
                                                (|SPADfirst|
                                                 |varList3|)
                                                |t1|)
                                               (COND
                                                 ((NULL
                                                   (EQUAL |t2| |t1|))
                                                  (EXIT
                                                   (|error|
                                                    "tubePlot: only one variable may be used")))))
                                              ('T
                                               (EXIT
                                                (|error|
                                                 "tubePlot: only one variable may be used"))))
                                            (EXIT |t1|))))))))))))))))) 

(DEFUN |EXPRTUBE;tubePlot;3EMSMISTp;2|
       (|x| |y| |z| |colorFcn| |tRange| |radFcn| |n| |string| $)
  (PROG (|flag| |t| |xFunc| |yFunc| |zFunc| |xp| |yp| |zp| |sp| |Tx|
                |Ty| |Tz| |Txp| |Typ| |Tzp| K |Nx| |Ny| |Nz| |NxFunc|
                |NyFunc| |NzFunc| |Bx| |By| |Bz| |BxFunc| |ByFunc|
                |BzFunc| |parPlot| |cosSin| |tval| |tvals| |ctr|
                |curvePts| |pNormList| |pNorm| |bNormList| |bNorm|
                |lps| |loopList|)
    (RETURN
      (SEQ (COND
             ((< |n| 3) (|error| "tubePlot: n should be at least 3"))
             (#0='T
              (SEQ (LETT |flag|
                         (COND
                           ((EQUAL |string| "closed") 'T)
                           ((EQUAL |string| "open") 'NIL)
                           (#0#
                            (|error| "tubePlot: last argument should be open or closed")))
                         . #1=(|EXPRTUBE;tubePlot;3EMSMISTp;2|))
                   (LETT |t|
                         (|EXPRTUBE;getVariable| |x| |y| |z| $) . #1#)
                   (LETT |xFunc|
                         (SPADCALL |x| |t| (QREFELT $ 13)) . #1#)
                   (LETT |yFunc|
                         (SPADCALL |y| |t| (QREFELT $ 13)) . #1#)
                   (LETT |zFunc|
                         (SPADCALL |z| |t| (QREFELT $ 13)) . #1#)
                   (LETT |xp| (SPADCALL |x| |t| (QREFELT $ 14)) . #1#)
                   (LETT |yp| (SPADCALL |y| |t| (QREFELT $ 14)) . #1#)
                   (LETT |zp| (SPADCALL |z| |t| (QREFELT $ 14)) . #1#)
                   (LETT |sp|
                         (SPADCALL
                             (SPADCALL
                                 (SPADCALL
                                     (SPADCALL |xp| 2 (QREFELT $ 16))
                                     (SPADCALL |yp| 2 (QREFELT $ 16))
                                     (QREFELT $ 17))
                                 (SPADCALL |zp| 2 (QREFELT $ 16))
                                 (QREFELT $ 17))
                             (QREFELT $ 18)) . #1#)
                   (LETT |Tx|
                         (SPADCALL |xp| |sp| (QREFELT $ 19)) . #1#)
                   (LETT |Ty|
                         (SPADCALL |yp| |sp| (QREFELT $ 19)) . #1#)
                   (LETT |Tz|
                         (SPADCALL |zp| |sp| (QREFELT $ 19)) . #1#)
                   (LETT |Txp|
                         (SPADCALL |Tx| |t| (QREFELT $ 14)) . #1#)
                   (LETT |Typ|
                         (SPADCALL |Ty| |t| (QREFELT $ 14)) . #1#)
                   (LETT |Tzp|
                         (SPADCALL |Tz| |t| (QREFELT $ 14)) . #1#)
                   (LETT K
                         (SPADCALL
                             (SPADCALL
                                 (SPADCALL
                                     (SPADCALL |Txp| 2 (QREFELT $ 16))
                                     (SPADCALL |Typ| 2 (QREFELT $ 16))
                                     (QREFELT $ 17))
                                 (SPADCALL |Tzp| 2 (QREFELT $ 16))
                                 (QREFELT $ 17))
                             (QREFELT $ 18)) . #1#)
                   (LETT |Nx| (SPADCALL |Txp| K (QREFELT $ 19)) . #1#)
                   (LETT |Ny| (SPADCALL |Typ| K (QREFELT $ 19)) . #1#)
                   (LETT |Nz| (SPADCALL |Tzp| K (QREFELT $ 19)) . #1#)
                   (LETT |NxFunc|
                         (SPADCALL |Nx| |t| (QREFELT $ 13)) . #1#)
                   (LETT |NyFunc|
                         (SPADCALL |Ny| |t| (QREFELT $ 13)) . #1#)
                   (LETT |NzFunc|
                         (SPADCALL |Nz| |t| (QREFELT $ 13)) . #1#)
                   (LETT |Bx|
                         (SPADCALL (SPADCALL |Ty| |Nz| (QREFELT $ 20))
                             (SPADCALL |Tz| |Ny| (QREFELT $ 20))
                             (QREFELT $ 21)) . #1#)
                   (LETT |By|
                         (SPADCALL (SPADCALL |Tz| |Nx| (QREFELT $ 20))
                             (SPADCALL |Tx| |Nz| (QREFELT $ 20))
                             (QREFELT $ 21)) . #1#)
                   (LETT |Bz|
                         (SPADCALL (SPADCALL |Tx| |Ny| (QREFELT $ 20))
                             (SPADCALL |Ty| |Nx| (QREFELT $ 20))
                             (QREFELT $ 21)) . #1#)
                   (LETT |BxFunc|
                         (SPADCALL |Bx| |t| (QREFELT $ 13)) . #1#)
                   (LETT |ByFunc|
                         (SPADCALL |By| |t| (QREFELT $ 13)) . #1#)
                   (LETT |BzFunc|
                         (SPADCALL |Bz| |t| (QREFELT $ 13)) . #1#)
                   (LETT |parPlot|
                         (SPADCALL |xFunc| |yFunc| |zFunc| |colorFcn|
                             |tRange| (QREFELT $ 24)) . #1#)
                   (LETT |tvals|
                         (|SPADfirst|
                             (SPADCALL |parPlot| (QREFELT $ 26))) . #1#)
                   (LETT |curvePts|
                         (|SPADfirst|
                             (SPADCALL |parPlot| (QREFELT $ 28))) . #1#)
                   (LETT |cosSin| (SPADCALL |n| (QREFELT $ 31)) . #1#)
                   (LETT |loopList| NIL . #1#)
                   (SEQ G190
                        (COND
                          ((NULL (COND ((NULL |tvals|) 'NIL) ('T 'T)))
                           (GO G191)))
                        (SEQ (LETT |tval| (|SPADfirst| |tvals|) . #1#)
                             (LETT |tvals| (CDR |tvals|) . #1#)
                             (LETT |ctr|
                                   (|SPADfirst| |curvePts|) . #1#)
                             (LETT |curvePts| (CDR |curvePts|) . #1#)
                             (LETT |pNormList|
                                   (LIST (SPADCALL |tval| |NxFunc|)
                                    (SPADCALL |tval| |NyFunc|)
                                    (SPADCALL |tval| |NzFunc|)
                                    (SPADCALL |tval| |colorFcn|)) . #1#)
                             (LETT |pNorm|
                                   (SPADCALL |pNormList|
                                    (QREFELT $ 34)) . #1#)
                             (LETT |bNormList|
                                   (LIST (SPADCALL |tval| |BxFunc|)
                                    (SPADCALL |tval| |ByFunc|)
                                    (SPADCALL |tval| |BzFunc|)
                                    (SPADCALL |tval| |colorFcn|)) . #1#)
                             (LETT |bNorm|
                                   (SPADCALL |bNormList|
                                    (QREFELT $ 34)) . #1#)
                             (LETT |lps|
                                   (SPADCALL |ctr| |pNorm| |bNorm|
                                    (SPADCALL |tval| |radFcn|) |cosSin|
                                    (QREFELT $ 37)) . #1#)
                             (EXIT (LETT |loopList|
                                    (CONS |lps| |loopList|) . #1#)))
                        NIL (GO G190) G191 (EXIT NIL))
                   (EXIT (SPADCALL |parPlot| (NREVERSE |loopList|)
                             |flag| (QREFELT $ 40)))))))))) 

(DEFUN |EXPRTUBE;tubePlot;3EMSMITp;3|
       (|x| |y| |z| |colorFcn| |tRange| |radFcn| |n| $)
  (SPADCALL |x| |y| |z| |colorFcn| |tRange| |radFcn| |n| "open"
      (QREFELT $ 42))) 

(PUT '|EXPRTUBE;project| '|SPADreplace| '(XLAM (|x| |y|) |x|)) 

(DEFUN |EXPRTUBE;project| (|x| |y| $) |x|) 

(DEFUN |EXPRTUBE;constantToUnaryFunction;DfM;5| (|x| $)
  (CONS #'|EXPRTUBE;constantToUnaryFunction;DfM;5!0| (VECTOR $ |x|))) 

(DEFUN |EXPRTUBE;constantToUnaryFunction;DfM;5!0| (|#1| $$)
  (|EXPRTUBE;project| (QREFELT $$ 1) |#1| (QREFELT $$ 0))) 

(DEFUN |EXPRTUBE;tubePlot;3EMSDfISTp;6|
       (|x| |y| |z| |colorFcn| |tRange| |rad| |n| |s| $)
  (SPADCALL |x| |y| |z| |colorFcn| |tRange|
      (SPADCALL |rad| (QREFELT $ 44)) |n| |s| (QREFELT $ 42))) 

(DEFUN |EXPRTUBE;tubePlot;3EMSDfITp;7|
       (|x| |y| |z| |colorFcn| |tRange| |rad| |n| $)
  (SPADCALL |x| |y| |z| |colorFcn| |tRange| |rad| |n| "open"
      (QREFELT $ 45))) 

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

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

(MAKEPROP '|ExpressionTubePlot| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|List| 11) (|Expression| 29)
             (0 . |variables|) (5 . |One|) (|Mapping| 36 36) (|Symbol|)
             (|MakeFloatCompiledFunction| 7) (9 . |makeFloatFunction|)
             (15 . |differentiate|) (|PositiveInteger|) (21 . **)
             (27 . +) (33 . |sqrt|) (38 . /) (44 . *) (50 . -)
             (|Segment| 36) (|Plot3D|) (56 . |plot|) (|List| 32)
             (65 . |tValues|) (|List| 35) (70 . |listBranches|)
             (|Integer|) (|TubePlotTools|) (75 . |cosSinInfo|)
             (|List| 36) (|Point| 36) (80 . |point|) (|List| 33)
             (|DoubleFloat|) (85 . |loopPoints|) (|Boolean|)
             (|TubePlot| 23) (94 . |tube|) (|String|)
             |EXPRTUBE;tubePlot;3EMSMISTp;2|
             |EXPRTUBE;tubePlot;3EMSMITp;3|
             |EXPRTUBE;constantToUnaryFunction;DfM;5|
             |EXPRTUBE;tubePlot;3EMSDfISTp;6|
             |EXPRTUBE;tubePlot;3EMSDfITp;7|)
          '#(|tubePlot| 101 |constantToUnaryFunction| 147) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 46
                                '(1 7 6 0 8 0 7 0 9 2 12 10 7 11 13 2 7
                                  0 0 11 14 2 7 0 0 15 16 2 7 0 0 0 17
                                  1 7 0 0 18 2 7 0 0 0 19 2 7 0 0 0 20
                                  2 7 0 0 0 21 5 23 0 10 10 10 10 22 24
                                  1 23 25 0 26 1 23 27 0 28 1 30 25 29
                                  31 1 33 0 32 34 5 30 35 33 33 33 36
                                  25 37 3 39 0 23 27 38 40 7 0 39 7 7 7
                                  10 22 10 29 43 8 0 39 7 7 7 10 22 10
                                  29 41 42 8 0 39 7 7 7 10 22 36 29 41
                                  45 7 0 39 7 7 7 10 22 36 29 46 1 0 10
                                  36 44)))))
          '|lookupComplete|)) 

(MAKEPROP '|ExpressionTubePlot| 'NILADIC T) 
