
(/VERSIONCHECK 2) 

(DEFUN |DRAWCURV;drawToScaleRanges| (|xVals| |yVals| $)
  (PROG (|xHi| |xLo| |yHi| |yLo| |xDiff| |yDiff| |pad|)
    (RETURN
      (SEQ (LETT |xHi| (SPADCALL |xVals| (QREFELT $ 10))
                 . #0=(|DRAWCURV;drawToScaleRanges|))
           (LETT |xLo| (SPADCALL |xVals| (QREFELT $ 11)) . #0#)
           (LETT |yHi| (SPADCALL |yVals| (QREFELT $ 10)) . #0#)
           (LETT |yLo| (SPADCALL |yVals| (QREFELT $ 11)) . #0#)
           (LETT |xDiff| (SPADCALL |xHi| |xLo| (QREFELT $ 12)) . #0#)
           (LETT |yDiff| (SPADCALL |yHi| |yLo| (QREFELT $ 12)) . #0#)
           (LETT |pad|
                 (SPADCALL
                     (SPADCALL
                         (SPADCALL |yDiff| |xDiff| (QREFELT $ 12))
                         (QREFELT $ 13))
                     2 (QREFELT $ 15)) . #0#)
           (EXIT (COND
                   ((SPADCALL |xDiff| |yDiff| (QREFELT $ 17))
                    (LIST (SPADCALL
                              (SPADCALL |xLo| |pad| (QREFELT $ 12))
                              (SPADCALL |xHi| |pad| (QREFELT $ 18))
                              (QREFELT $ 19))
                          |yVals|))
                   ('T
                    (LIST |xVals|
                          (SPADCALL
                              (SPADCALL |yLo| |pad| (QREFELT $ 12))
                              (SPADCALL |yHi| |pad| (QREFELT $ 18))
                              (QREFELT $ 19)))))))))) 

(DEFUN |DRAWCURV;intConvert| (|r| $)
  (PROG (|nn|)
    (RETURN
      (SEQ (LETT |nn| (SPADCALL |r| (QREFELT $ 21))
                 |DRAWCURV;intConvert|)
           (EXIT (COND
                   ((QEQCAR |nn| 1)
                    (|error| "draw: polynomial must have rational coefficients"))
                   ('T (QCDR |nn|)))))))) 

(DEFUN |DRAWCURV;polyEquation| (|eq| $)
  (PROG (|ff| |r| |rat|)
    (RETURN
      (SEQ (LETT |ff|
                 (SPADCALL (SPADCALL |eq| (QREFELT $ 23))
                     (SPADCALL |eq| (QREFELT $ 24)) (QREFELT $ 25))
                 . #0=(|DRAWCURV;polyEquation|))
           (LETT |r| (SPADCALL |ff| (QREFELT $ 27)) . #0#)
           (EXIT (COND
                   ((QEQCAR |r| 1)
                    (|error| "draw: not a polynomial equation"))
                   ('T
                    (SEQ (LETT |rat| (QCDR |r|) . #0#)
                         (EXIT (COND
                                 ((QEQCAR (SPADCALL
                                           (SPADCALL |rat|
                                            (QREFELT $ 30))
                                           (QREFELT $ 32))
                                          1)
                                  (|error| "draw: non-constant denominator"))
                                 ('T
                                  (SPADCALL
                                      (CONS
                                       (|function|
                                        |DRAWCURV;intConvert|)
                                       $)
                                      (SPADCALL |rat| (QREFELT $ 33))
                                      (QREFELT $ 37))))))))))))) 

(DEFUN |DRAWCURV;draw;E2SLTdv;4| (|eq| |x| |y| |l| $)
  (PROG (|p| |floatRange| |ratRange| #0=#:G1850 |ranges| |xRange|
             |yRange| |xRangeFloat| |yRangeFloat| |floatRanges|
             |acplot| |scaledRanges| |ptCol| |crCol|)
    (RETURN
      (SEQ (LETT |p| (|DRAWCURV;polyEquation| |eq| $)
                 . #1=(|DRAWCURV;draw;E2SLTdv;4|))
           (LETT |floatRange|
                 (SPADCALL |l| (SPADCALL "rangeFloat" (QREFELT $ 40))
                     (QREFELT $ 44)) . #1#)
           (LETT |ratRange|
                 (SPADCALL |l| (SPADCALL "rangeRat" (QREFELT $ 40))
                     (QREFELT $ 44)) . #1#)
           (COND
             ((QEQCAR |floatRange| 1)
              (COND
                ((QEQCAR |ratRange| 1)
                 (EXIT (|error| "draw: you must specify ranges for an implicit plot"))))))
           (LETT |ranges| NIL . #1#) (LETT |floatRanges| NIL . #1#)
           (LETT |xRange|
                 (SPADCALL (|spadConstant| $ 48) (|spadConstant| $ 48)
                     (QREFELT $ 50)) . #1#)
           (LETT |yRange|
                 (SPADCALL (|spadConstant| $ 48) (|spadConstant| $ 48)
                     (QREFELT $ 50)) . #1#)
           (LETT |xRangeFloat|
                 (SPADCALL (|spadConstant| $ 51) (|spadConstant| $ 51)
                     (QREFELT $ 19)) . #1#)
           (LETT |yRangeFloat|
                 (SPADCALL (|spadConstant| $ 51) (|spadConstant| $ 51)
                     (QREFELT $ 19)) . #1#)
           (COND
             ((QEQCAR |ratRange| 1)
              (SEQ (LETT |floatRanges|
                         (SPADCALL
                             (PROG2 (LETT #0# |floatRange| . #1#)
                                    (QCDR #0#)
                               (|check-union| (QEQCAR #0# 0) (|Any|)
                                   #0#))
                             (QREFELT $ 55)) . #1#)
                   (COND
                     ((NULL (SPADCALL |floatRanges| 2 (QREFELT $ 57)))
                      (EXIT (|error| "draw: you must specify two ranges"))))
                   (LETT |xRangeFloat|
                         (|SPADfirst| |floatRanges|) . #1#)
                   (LETT |yRangeFloat|
                         (SPADCALL |floatRanges| (QREFELT $ 58)) . #1#)
                   (LETT |xRange|
                         (SPADCALL
                             (CONS #'|DRAWCURV;draw;E2SLTdv;4!0| $)
                             |xRangeFloat| (QREFELT $ 62)) . #1#)
                   (LETT |yRange|
                         (SPADCALL
                             (CONS #'|DRAWCURV;draw;E2SLTdv;4!1| $)
                             |yRangeFloat| (QREFELT $ 62)) . #1#)
                   (EXIT (LETT |ranges| (LIST |xRange| |yRange|) . #1#))))
             ('T
              (SEQ (LETT |ranges|
                         (SPADCALL (QCDR |ratRange|) (QREFELT $ 65)) . #1#)
                   (COND
                     ((NULL (SPADCALL |ranges| 2 (QREFELT $ 66)))
                      (EXIT (|error| "draw: you must specify two ranges"))))
                   (LETT |xRange| (|SPADfirst| |ranges|) . #1#)
                   (LETT |yRange|
                         (SPADCALL |ranges| (QREFELT $ 67)) . #1#)
                   (LETT |xRangeFloat|
                         (SPADCALL
                             (CONS #'|DRAWCURV;draw;E2SLTdv;4!2| $)
                             |xRange| (QREFELT $ 71)) . #1#)
                   (LETT |yRangeFloat|
                         (SPADCALL
                             (CONS #'|DRAWCURV;draw;E2SLTdv;4!3| $)
                             |yRange| (QREFELT $ 71)) . #1#)
                   (EXIT (LETT |floatRanges|
                               (LIST |xRangeFloat| |yRangeFloat|) . #1#)))))
           (LETT |acplot|
                 (SPADCALL |p| |x| |y| |xRange| |yRange|
                     (QREFELT $ 73)) . #1#)
           (COND
             ((SPADCALL |l| (SPADCALL (QREFELT $ 75)) (QREFELT $ 78))
              (SEQ (LETT |scaledRanges|
                         (|DRAWCURV;drawToScaleRanges| |xRangeFloat|
                             |yRangeFloat| $) . #1#)
                   (EXIT (LETT |l|
                               (CONS (SPADCALL |scaledRanges|
                                      (QREFELT $ 79))
                                     |l|) . #1#))))
             ('T
              (LETT |l|
                    (CONS (SPADCALL |floatRanges| (QREFELT $ 79)) |l|) . #1#)))
           (LETT |ptCol|
                 (SPADCALL |l| (SPADCALL (QREFELT $ 82))
                     (QREFELT $ 83)) . #1#)
           (LETT |crCol|
                 (SPADCALL |l| (SPADCALL (QREFELT $ 84))
                     (QREFELT $ 85)) . #1#)
           (EXIT (SPADCALL (SPADCALL |acplot| (QREFELT $ 87)) |ptCol|
                     |crCol| (SPADCALL (QREFELT $ 89)) |l|
                     (QREFELT $ 92))))))) 

(DEFUN |DRAWCURV;draw;E2SLTdv;4!3| (|#1| $)
  (SPADCALL |#1| (QREFELT $ 68))) 

(DEFUN |DRAWCURV;draw;E2SLTdv;4!2| (|#1| $)
  (SPADCALL |#1| (QREFELT $ 68))) 

(DEFUN |DRAWCURV;draw;E2SLTdv;4!1| (|#1| $)
  (SPADCALL |#1| (QREFELT $ 59))) 

(DEFUN |DRAWCURV;draw;E2SLTdv;4!0| (|#1| $)
  (SPADCALL |#1| (QREFELT $ 59))) 

(DEFUN |TopLevelDrawFunctionsForAlgebraicCurves| (&REST #0=#:G1862)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1863)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (|devaluateList| #0#)
                       (HGET |$ConstructorCache|
                             '|TopLevelDrawFunctionsForAlgebraicCurves|)
                       '|domainEqualList|)
                   . #2=(|TopLevelDrawFunctionsForAlgebraicCurves|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (APPLY (|function|
                                 |TopLevelDrawFunctionsForAlgebraicCurves;|)
                             #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache|
                        '|TopLevelDrawFunctionsForAlgebraicCurves|))))))))))) 

(DEFUN |TopLevelDrawFunctionsForAlgebraicCurves;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|TopLevelDrawFunctionsForAlgebraicCurves|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$|
              (LIST '|TopLevelDrawFunctionsForAlgebraicCurves| DV$1
                    DV$2) . #0#)
        (LETT $ (GETREFV 94) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache|
            '|TopLevelDrawFunctionsForAlgebraicCurves| (LIST DV$1 DV$2)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        $)))) 

(MAKEPROP '|TopLevelDrawFunctionsForAlgebraicCurves| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|Float|) (|Segment| 8) (0 . |hi|) (5 . |lo|) (10 . -)
             (16 . |abs|) (|Integer|) (21 . /) (|Boolean|) (27 . <)
             (33 . +) (39 . |segment|) (|Union| 14 '"failed")
             (45 . |retractIfCan|) (|Equation| 7) (50 . |lhs|)
             (55 . |rhs|) (60 . -) (|Union| 29 '"failed")
             (66 . |retractIfCan|) (|Polynomial| 6) (|Fraction| 28)
             (71 . |denom|) (|Union| 6 '"failed") (76 . |retractIfCan|)
             (81 . |numer|) (|Polynomial| 14) (|Mapping| 14 6)
             (|PolynomialFunctions2| 6 14) (86 . |map|) (|String|)
             (|Symbol|) (92 . |coerce|) (|Union| 53 '"failed")
             (|List| $) (|DrawOption|) (97 . |option|) (103 . |Zero|)
             (107 . |Zero|) (|Fraction| 14) (111 . |Zero|)
             (|Segment| 47) (115 . |segment|) (121 . |Zero|) (|List| 9)
             (|Any|) (|AnyFunctions1| 52) (125 . |retract|)
             (|NonNegativeInteger|) (130 . |size?|) (136 . |second|)
             (141 . |retract|) (|Mapping| 47 8)
             (|SegmentFunctions2| 8 47) (146 . |map|) (|List| 49)
             (|AnyFunctions1| 63) (152 . |retract|) (157 . |size?|)
             (163 . |second|) (168 . |convert|) (|Mapping| 8 47)
             (|SegmentFunctions2| 47 8) (173 . |map|)
             (|PlaneAlgebraicCurvePlot|) (179 . |makeSketch|)
             (|GraphicsDefaults|) (188 . |drawToScale|) (|List| 43)
             (|DrawOptionFunctions0|) (192 . |toScale|)
             (198 . |ranges|) (|Palette|) (|ViewDefaultsPackage|)
             (203 . |pointColorDefault|) (207 . |pointColorPalette|)
             (213 . |lineColorDefault|) (217 . |curveColorPalette|)
             (|List| (|List| (|Point| (|DoubleFloat|))))
             (223 . |listBranches|) (|PositiveInteger|)
             (228 . |pointSizeDefault|) (|TwoDimensionalViewport|)
             (|ViewportPackage|) (232 . |drawCurves|)
             |DRAWCURV;draw;E2SLTdv;4|)
          '#(|draw| 241) 'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 93
                                '(1 9 8 0 10 1 9 8 0 11 2 8 0 0 0 12 1
                                  8 0 0 13 2 8 0 0 14 15 2 8 16 0 0 17
                                  2 8 0 0 0 18 2 9 0 8 8 19 1 6 20 0 21
                                  1 22 7 0 23 1 22 7 0 24 2 7 0 0 0 25
                                  1 7 26 0 27 1 29 28 0 30 1 28 31 0 32
                                  1 29 28 0 33 2 36 34 35 28 37 1 39 0
                                  38 40 2 43 41 42 39 44 0 6 0 45 0 7 0
                                  46 0 47 0 48 2 49 0 47 47 50 0 8 0 51
                                  1 54 52 53 55 2 52 16 0 56 57 1 52 9
                                  0 58 1 8 47 0 59 2 61 49 60 9 62 1 64
                                  63 53 65 2 63 16 0 56 66 1 63 49 0 67
                                  1 47 8 0 68 2 70 9 69 49 71 5 72 0 34
                                  39 39 49 49 73 0 74 16 75 2 77 16 76
                                  16 78 1 43 0 52 79 0 81 80 82 2 77 80
                                  76 80 83 0 81 80 84 2 77 80 76 80 85
                                  1 72 86 0 87 0 81 88 89 5 91 90 86 80
                                  80 88 76 92 4 0 90 22 39 39 76 93)))))
          '|lookupComplete|)) 
