
(/VERSIONCHECK 2) 

(DEFUN |SCONF;colinearity;2$Df;1| (|x| |y| $)
  (DIV-DF (EXPT-DF-I (SPADCALL |x| |y| (QREFELT $ 8)) 2)
          (MUL-DF (SPADCALL |x| |x| (QREFELT $ 8))
                  (SPADCALL |y| |y| (QREFELT $ 8))))) 

(DEFUN |SCONF;sipnt;2I$;2| (|a| |b| $)
  (SPADCALL (FLOAT |a| MOST-POSITIVE-DOUBLE-FLOAT)
            (FLOAT |b| MOST-POSITIVE-DOUBLE-FLOAT) (QREFELT $ 10))) 

(DEFUN |SCONF;sipnt;3I$;3| (|a| |b| |c| $)
  (SPADCALL (FLOAT |a| MOST-POSITIVE-DOUBLE-FLOAT)
            (FLOAT |b| MOST-POSITIVE-DOUBLE-FLOAT)
            (FLOAT |c| MOST-POSITIVE-DOUBLE-FLOAT) (QREFELT $ 13))) 

(DEFUN |SCONF;sivec;2I$;4| (|a| |b| $)
  (SPADCALL (FLOAT |a| MOST-POSITIVE-DOUBLE-FLOAT)
            (FLOAT |b| MOST-POSITIVE-DOUBLE-FLOAT) (QREFELT $ 15))) 

(DEFUN |SCONF;sivec;3I$;5| (|a| |b| |c| $)
  (SPADCALL (FLOAT |a| MOST-POSITIVE-DOUBLE-FLOAT)
            (FLOAT |b| MOST-POSITIVE-DOUBLE-FLOAT)
            (FLOAT |c| MOST-POSITIVE-DOUBLE-FLOAT) (QREFELT $ 17))) 

(DEFUN |SCONF;distance;2$Df;6| (|p1| |p2| $)
  (SPADCALL (SPADCALL |p1| |p2| (QREFELT $ 19)) (QREFELT $ 20))) 

(DEFUN |SCONF;spnt;2Df$;7| (|a| |b| $)
  (PROG (|z| |inf|)
    (RETURN
     (SEQ
      (LETT |inf|
            (MUL-DF (ADD-DF (MUL-DF |a| |a|) (MUL-DF |b| |b|))
                    (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                              (QREFELT $ 28)))
            . #1=(|SCONF;spnt;2Df$;7|))
      (LETT |z| (MAKEARR1 (QREFELT $ 24) 0.0) . #1#)
      (QSETAREF1 |z| 1 (MINUS-DF 1.0)) (QSETAREF1 |z| 2 |inf|)
      (QSETAREF1 |z| 4 |a|) (QSETAREF1 |z| 8 |b|) (EXIT |z|))))) 

(DEFUN |SCONF;spnt;3Df$;8| (|a| |b| |c| $)
  (PROG (|z| |inf|)
    (RETURN
     (SEQ
      (LETT |inf|
            (MUL-DF
             (ADD-DF (ADD-DF (MUL-DF |a| |a|) (MUL-DF |b| |b|))
                     (MUL-DF |c| |c|))
             (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27)) (QREFELT $ 28)))
            . #1=(|SCONF;spnt;3Df$;8|))
      (LETT |z| (MAKEARR1 (QREFELT $ 24) 0.0) . #1#)
      (QSETAREF1 |z| 1 (MINUS-DF 1.0)) (QSETAREF1 |z| 2 |inf|)
      (QSETAREF1 |z| 4 |a|) (QSETAREF1 |z| 8 |b|)
      (COND ((< 2 (QREFELT $ 6)) (QSETAREF1 |z| 16 |c|))) (EXIT |z|))))) 

(DEFUN |SCONF;svec;2Df$;9| (|a| |b| $)
  (PROG (|z| |inf|)
    (RETURN
     (SEQ
      (LETT |inf|
            (MUL-DF (ADD-DF (MUL-DF |a| |a|) (MUL-DF |b| |b|))
                    (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                              (QREFELT $ 28)))
            . #1=(|SCONF;svec;2Df$;9|))
      (LETT |z| (MAKEARR1 (QREFELT $ 24) 0.0) . #1#)
      (QSETAREF1 |z| 1 (MINUS-DF 1.0)) (QSETAREF1 |z| 2 |inf|)
      (QSETAREF1 |z| 4 |a|) (QSETAREF1 |z| 8 |b|) (EXIT |z|))))) 

(DEFUN |SCONF;svec;3Df$;10| (|a| |b| |c| $)
  (PROG (|z| |inf|)
    (RETURN
     (SEQ
      (LETT |inf|
            (MUL-DF
             (ADD-DF (ADD-DF (MUL-DF |a| |a|) (MUL-DF |b| |b|))
                     (MUL-DF |c| |c|))
             (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27)) (QREFELT $ 28)))
            . #1=(|SCONF;svec;3Df$;10|))
      (LETT |z| (MAKEARR1 (QREFELT $ 24) 0.0) . #1#)
      (QSETAREF1 |z| 1 (MINUS-DF 1.0)) (QSETAREF1 |z| 2 |inf|)
      (QSETAREF1 |z| 4 |a|) (QSETAREF1 |z| 8 |b|)
      (COND ((< 2 (QREFELT $ 6)) (QSETAREF1 |z| 16 |c|))) (EXIT |z|))))) 

(PUT '|SCONF;dimension;$Pi;11| '|SPADreplace| '(XLAM (|p|) 2)) 

(DEFUN |SCONF;dimension;$Pi;11| (|p| $) 2) 

(DEFUN |SCONF;nan?| (|x| $) (COND ((EQL-DF |x| |x|) 'NIL) ('T 'T))) 

(DEFUN |SCONF;Pnan?;$B;13| (|p| $)
  (COND
   ((OR (|SCONF;nan?| (QAREF1 |p| 4) $) (|SCONF;nan?| (QAREF1 |p| 8) $)) 'T)
   ('T 'NIL))) 

(DEFUN |SCONF;unitVector;2$;14| (|p| $)
  (PROG (|pt| |factor|)
    (RETURN
     (SEQ
      (LETT |factor|
            (SPADCALL
             (ADD-DF (MUL-DF (QAREF1 |p| 4) (QAREF1 |p| 4))
                     (MUL-DF (QAREF1 |p| 8) (QAREF1 |p| 8)))
             (QREFELT $ 20))
            . #1=(|SCONF;unitVector;2$;14|))
      (LETT |pt| (MAKEARR1 (QREFELT $ 24) 0.0) . #1#)
      (QSETAREF1 |pt| 4 (DIV-DF (QAREF1 |p| 4) |factor|))
      (QSETAREF1 |pt| 8 (DIV-DF (QAREF1 |p| 8) |factor|))
      (QSETAREF1 |pt| 2
                 (MUL-DF
                  (ADD-DF (MUL-DF (QAREF1 |pt| 4) (QAREF1 |pt| 4))
                          (MUL-DF (QAREF1 |pt| 8) (QAREF1 |pt| 8)))
                  (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27)) (QREFELT $ 28))))
      (QSETAREF1 |pt| 1 (MINUS-DF 1.0)) (EXIT |pt|))))) 

(DEFUN |SCONF;parallel;2$Df;15| (|x| |y| $)
  (ADD-DF (MUL-DF (QAREF1 |x| 6) (QAREF1 |y| 6))
          (MUL-DF (QAREF1 |x| 10) (QAREF1 |y| 10)))) 

(DEFUN |SCONF;perpendicular;3$;16| (|x| |y| $)
  (PROG (|pt|)
    (RETURN
     (SEQ (LETT |pt| (MAKEARR1 (QREFELT $ 24) 0.0) |SCONF;perpendicular;3$;16|)
          (QSETAREF1 |pt| 4 0.0) (QSETAREF1 |pt| 8 1.0)
          (QSETAREF1 |pt| 2
                     (MUL-DF
                      (ADD-DF (MUL-DF (QAREF1 |pt| 4) (QAREF1 |pt| 4))
                              (MUL-DF (QAREF1 |pt| 8) (QAREF1 |pt| 8)))
                      (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                                (QREFELT $ 28))))
          (QSETAREF1 |pt| 1 (MINUS-DF 1.0)) (EXIT |pt|))))) 

(DEFUN |SCONF;*;Df2$;17| (|s| |x| $)
  (PROG (|pt|)
    (RETURN
     (SEQ (LETT |pt| (MAKEARR1 (QREFELT $ 24) 0.0) |SCONF;*;Df2$;17|)
          (QSETAREF1 |pt| 4 (MUL-DF (QAREF1 |x| 4) |s|))
          (QSETAREF1 |pt| 8 (MUL-DF (QAREF1 |x| 8) |s|))
          (QSETAREF1 |pt| 2
                     (MUL-DF
                      (ADD-DF (MUL-DF (QAREF1 |pt| 4) (QAREF1 |pt| 4))
                              (MUL-DF (QAREF1 |pt| 8) (QAREF1 |pt| 8)))
                      (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                                (QREFELT $ 28))))
          (QSETAREF1 |pt| 1 (MINUS-DF 1.0)) (EXIT |pt|))))) 

(DEFUN |SCONF;+;3$;18| (|x| |y| $)
  (PROG (|pt|)
    (RETURN
     (SEQ (LETT |pt| (MAKEARR1 (QREFELT $ 24) 0.0) |SCONF;+;3$;18|)
          (QSETAREF1 |pt| 4 (ADD-DF (QAREF1 |x| 4) (QAREF1 |y| 4)))
          (QSETAREF1 |pt| 8 (ADD-DF (QAREF1 |x| 8) (QAREF1 |y| 8)))
          (QSETAREF1 |pt| 2
                     (MUL-DF
                      (ADD-DF (MUL-DF (QAREF1 |pt| 4) (QAREF1 |pt| 4))
                              (MUL-DF (QAREF1 |pt| 8) (QAREF1 |pt| 8)))
                      (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                                (QREFELT $ 28))))
          (QSETAREF1 |pt| 1 (MINUS-DF 1.0)) (EXIT |pt|))))) 

(DEFUN |SCONF;-;3$;19| (|x| |y| $)
  (PROG (|pt|)
    (RETURN
     (SEQ (LETT |pt| (MAKEARR1 (QREFELT $ 24) 0.0) |SCONF;-;3$;19|)
          (QSETAREF1 |pt| 4 (SUB-DF (QAREF1 |x| 4) (QAREF1 |y| 4)))
          (QSETAREF1 |pt| 8 (SUB-DF (QAREF1 |x| 8) (QAREF1 |y| 8)))
          (QSETAREF1 |pt| 2
                     (MUL-DF
                      (ADD-DF (MUL-DF (QAREF1 |pt| 4) (QAREF1 |pt| 4))
                              (MUL-DF (QAREF1 |pt| 8) (QAREF1 |pt| 8)))
                      (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                                (QREFELT $ 28))))
          (QSETAREF1 |pt| 1 (MINUS-DF 1.0)) (EXIT |pt|))))) 

(DEFUN |SCONF;inBounds?;3$B;20| (|pt| |mns| |mxs| $)
  (COND
   ((OR (LESS-DF (QAREF1 |pt| 4) (QAREF1 |mns| 4))
        (OR (LESS-DF (QAREF1 |mxs| 4) (QAREF1 |pt| 4))
            (OR (LESS-DF (QAREF1 |pt| 8) (QAREF1 |mns| 8))
                (LESS-DF (QAREF1 |mxs| 8) (QAREF1 |pt| 8)))))
    'NIL)
   ('T 'T))) 

(PUT '|SCONF;screenCoordX;$Df;21| '|SPADreplace| '(XLAM (|pt|) (QAREF1 |pt| 4))) 

(DEFUN |SCONF;screenCoordX;$Df;21| (|pt| $) (QAREF1 |pt| 4)) 

(PUT '|SCONF;screenCoordY;$Df;22| '|SPADreplace| '(XLAM (|pt|) (QAREF1 |pt| 8))) 

(DEFUN |SCONF;screenCoordY;$Df;22| (|pt| $) (QAREF1 |pt| 8)) 

(DEFUN |SCONF;screenCoordZ;$Df;23| (|pt| $)
  (COND ((< 2 (QREFELT $ 6)) (QAREF1 |pt| 16)) ('T 0.0))) 

(DEFUN |SCONF;screenCoords;$L;24| (|pt| $)
  (PROG (#1=#:G1854)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (COND
         ((< 2 (QREFELT $ 6))
          (PROGN
           (LETT #1# (LIST (QAREF1 |pt| 4) (QAREF1 |pt| 8) (QAREF1 |pt| 16))
                 |SCONF;screenCoords;$L;24|)
           (GO #1#))))
        (EXIT (LIST (QAREF1 |pt| 4) (QAREF1 |pt| 8)))))
      #1# (EXIT #1#))))) 

(DEFUN |SCONF;extendedCoords;$L;25| (|pt| $) (SPADCALL |pt| (QREFELT $ 46))) 

(DEFUN |SCONF;normalisePoint;2$;26| (|pt| $)
  (PROG (|infin| |index| #1=#:G1866 |x| |pt2| #2=#:G1865 |scaleFactor|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |scaleFactor| (QAREF1 |pt| 1)
              . #3=(|SCONF;normalisePoint;2$;26|))
        (COND
         ((LESS-DF |scaleFactor|
                   (SPADCALL (SPADCALL 1 -2 10 (QREFELT $ 27)) (QREFELT $ 28)))
          (COND
           ((LESS-DF
             (MINUS-DF
              (SPADCALL (SPADCALL 1 -2 10 (QREFELT $ 27)) (QREFELT $ 28)))
             |scaleFactor|)
            (SEQ (|sayTeX| "can't apply normalisePoint to a vector")
                 (EXIT (PROGN (LETT #2# |pt| . #3#) (GO #2#))))))))
        (COND
         ((LESS-DF |scaleFactor|
                   (MINUS-DF
                    (SPADCALL (SPADCALL 99 -2 10 (QREFELT $ 27))
                              (QREFELT $ 28))))
          (COND
           ((LESS-DF
             (MINUS-DF
              (SPADCALL (SPADCALL 101 -2 10 (QREFELT $ 27)) (QREFELT $ 28)))
             |scaleFactor|)
            (PROGN (LETT #2# |pt| . #3#) (GO #2#))))))
        (LETT |pt2| (MAKEARR1 (QREFELT $ 24) 0.0) . #3#)
        (LETT |infin| 0.0 . #3#)
        (SEQ (LETT |x| 1 . #3#) (LETT #1# (QREFELT $ 6) . #3#) G190
             (COND ((QSGREATERP |x| #1#) (GO G191)))
             (SEQ (LETT |index| (EXPT 2 (+ |x| 1)) . #3#)
                  (QSETAREF1 |pt2| |index|
                             (DIV-DF (QAREF1 |pt| |index|)
                                     (MINUS-DF |scaleFactor|)))
                  (EXIT
                   (LETT |infin|
                         (ADD-DF |infin|
                                 (MUL-DF
                                  (MUL-DF (QAREF1 |pt2| |index|)
                                          (QAREF1 |pt2| |index|))
                                  (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 27))
                                            (QREFELT $ 28))))
                         . #3#)))
             (LETT |x| (QSADD1 |x|) . #3#) (GO G190) G191 (EXIT NIL))
        (QSETAREF1 |pt2| 1 (MINUS-DF 1.0)) (QSETAREF1 |pt2| 2 |infin|)
        (|sayTeX|
         (SPADCALL
          (LIST "normalisePoint " (|mathObject2String| |pt|) " normalised to "
                (|mathObject2String| |pt2|) ")")
          (QREFELT $ 50)))
        (EXIT |pt2|)))
      #2# (EXIT #2#))))) 

(PUT '|SCONF;hash;$Si;27| '|SPADreplace| '(XLAM (|s|) 0)) 

(DEFUN |SCONF;hash;$Si;27| (|s| $) 0) 

(PUT '|SCONF;latex;$S;28| '|SPADreplace|
     '(XLAM (|s|) "\\mbox{\\bf Unimplemented}")) 

(DEFUN |SCONF;latex;$S;28| (|s| $) "\\mbox{\\bf Unimplemented}") 

(DEFUN |SCONF;=;2$B;29| (|x| |y| $)
  (PROG (#1=#:G1872 #2=#:G1873 |i|)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (SEQ (LETT |i| 0 . #3=(|SCONF;=;2$B;29|))
             (LETT #2# (- (QREFELT $ 24) 1) . #3#) G190
             (COND ((QSGREATERP |i| #2#) (GO G191)))
             (SEQ
              (EXIT
               (COND
                ((NULL (EQL-DF (QAREF1 |x| |i|) (QAREF1 |y| |i|)))
                 (PROGN (LETT #1# 'NIL . #3#) (GO #1#))))))
             (LETT |i| (QSADD1 |i|) . #3#) (GO G190) G191 (EXIT NIL))
        (EXIT 'T)))
      #1# (EXIT #1#))))) 

(DEFUN |SCONF;~=;2$B;30| (|x| |y| $)
  (COND ((SPADCALL |x| |y| (QREFELT $ 55)) 'NIL) ('T 'T))) 

(DEFUN |SCONF;coerce;$Of;31| (|pt| $)
  (PROG (|s|)
    (RETURN
     (SEQ (LETT |s| "proj" . #1=(|SCONF;coerce;$Of;31|))
          (COND ((EQL-DF (QAREF1 |pt| 4) 0.0) (LETT |s| "v" . #1#)))
          (COND ((EQL-DF (QAREF1 |pt| 4) 1.0) (LETT |s| "p" . #1#)))
          (EXIT
           (SPADCALL
            (LIST (SPADCALL |s| (QREFELT $ 58))
                  (SPADCALL (QAREF1 |pt| 4) (QREFELT $ 59))
                  (SPADCALL (QAREF1 |pt| 8) (QREFELT $ 59)))
            (QREFELT $ 60))))))) 

(DEFUN |SConformal| (#1=#:G1879)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1880)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|SConformal|)
                                           '|domainEqualList|)
                . #3=(|SConformal|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT (PROG1 (|SConformal;| #1#) (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|SConformal|))))))))))) 

(DEFUN |SConformal;| (|#1|)
  (PROG (|pv$| $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|SConformal|))
      (LETT |dv$| (LIST '|SConformal| DV$1) . #1#)
      (LETT $ (GETREFV 62) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|SConformal| (LIST DV$1) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 24 (SPADCALL 2 (+ |#1| 2) (QREFELT $ 23)))
      (QSETREFV $ 25 (|PrimitiveArray| (|DoubleFloat|)))
      $)))) 

(MAKEPROP '|SConformal| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL (|Type|) (|local| |#1|) (|DoubleFloat|)
              |SCONF;parallel;2$Df;15| |SCONF;colinearity;2$Df;1|
              |SCONF;spnt;2Df$;7| (|Integer|) |SCONF;sipnt;2I$;2|
              |SCONF;spnt;3Df$;8| |SCONF;sipnt;3I$;3| |SCONF;svec;2Df$;9|
              |SCONF;sivec;2I$;4| |SCONF;svec;3Df$;10| |SCONF;sivec;3I$;5|
              (0 . |distanceSquared|) (6 . |sqrt|) |SCONF;distance;2$Df;6|
              (|PositiveInteger|) (11 . ^) '|dim| '|Rep| (|Float|)
              (17 . |float|) (24 . |coerce|) (|Fraction| 11) (29 . |One|)
              (33 . |One|) |SCONF;dimension;$Pi;11| (|Boolean|)
              |SCONF;Pnan?;$B;13| |SCONF;unitVector;2$;14|
              |SCONF;perpendicular;3$;16| |SCONF;*;Df2$;17| |SCONF;+;3$;18|
              |SCONF;-;3$;19| |SCONF;inBounds?;3$B;20|
              |SCONF;screenCoordX;$Df;21| |SCONF;screenCoordY;$Df;22|
              |SCONF;screenCoordZ;$Df;23| (|List| 7) |SCONF;screenCoords;$L;24|
              (37 . |entries|) |SCONF;extendedCoords;$L;25| (|List| $)
              (|String|) (42 . |concat|) |SCONF;normalisePoint;2$;26|
              (|SingleInteger|) |SCONF;hash;$Si;27| |SCONF;latex;$S;28|
              |SCONF;=;2$B;29| |SCONF;~=;2$B;30| (|OutputForm|) (47 . |coerce|)
              (52 . |coerce|) (57 . |paren|) |SCONF;coerce;$Of;31|)
           '#(~= 62 |unitVector| 68 |svec| 73 |spnt| 86 |sivec| 99 |sipnt| 112
              |screenCoords| 125 |screenCoordZ| 130 |screenCoordY| 135
              |screenCoordX| 140 |perpendicular| 145 |parallel| 151
              |normalisePoint| 157 |latex| 162 |inBounds?| 167 |hash| 174
              |extendedCoords| 179 |distanceSquared| 184 |distance| 190
              |dimension| 196 |colinearity| 201 |coerce| 207 |Pnan?| 212 = 217
              - 223 + 229 * 235)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0 0))
                 (CONS '#(NIL |SetCategory&| |BasicType&| NIL)
                       (CONS
                        '#((|SPointCategory|) (|SetCategory|) (|BasicType|)
                           (|CoercibleTo| 57))
                        (|makeByteWordVec2| 61
                                            '(2 0 7 0 0 19 1 7 0 0 20 2 22 0 0
                                              22 23 3 26 0 11 11 22 27 1 26 7 0
                                              28 0 29 0 30 0 26 0 31 1 25 44 0
                                              46 1 49 0 48 50 1 49 57 0 58 1 7
                                              57 0 59 1 57 0 48 60 2 0 33 0 0
                                              56 1 0 0 0 35 3 0 0 7 7 7 17 2 0
                                              0 7 7 15 3 0 0 7 7 7 13 2 0 0 7 7
                                              10 3 0 0 11 11 11 18 2 0 0 11 11
                                              16 3 0 0 11 11 11 14 2 0 0 11 11
                                              12 1 0 44 0 45 1 0 7 0 43 1 0 7 0
                                              42 1 0 7 0 41 2 0 0 0 0 36 2 0 7
                                              0 0 8 1 0 0 0 51 1 0 49 0 54 3 0
                                              33 0 0 0 40 1 0 52 0 53 1 0 44 0
                                              47 2 0 7 0 0 19 2 0 7 0 0 21 1 0
                                              22 0 32 2 0 7 0 0 9 1 0 57 0 61 1
                                              0 33 0 34 2 0 33 0 0 55 2 0 0 0 0
                                              39 2 0 0 0 0 38 2 0 0 7 0 37)))))
           '|lookupComplete|)) 
