anchor.diff:                          (floor pt1x) (floor pt1y)
                           (floor pt2x) (floor pt2y)))))
   
  -(defun draw-pt3d (canvas mat pt xmin xmax ymin ymax width height &optional (tick-size 0.125))
  +(declaim (inline draw-quad))
  +(defun draw-quad (canvas mat p1 p2 p3 p4)
  +  (declare (type matrix mat)
  +           (type pt3d p1 p2 p3 p4))
  +  (draw-line3d canvas mat p1 p2)
  +  (draw-line3d canvas mat p2 p3)
  +  (draw-line3d canvas mat p3 p4)
  +  (draw-line3d canvas mat p4 p1))
  +
  +(defun draw-pt3d (canvas mat pt &optional (tick-size 0.125))
     "Draw a point as a mini-axis."
     (let ((tp (create-pt3d (pt3d-x pt) (+ (pt3d-y pt) tick-size) (pt3d-z pt)))
           (bp (create-pt3d (pt3d-x pt) (- (pt3d-y pt) tick-size) (pt3d-z pt)))
  -
           (lp (create-pt3d (- (pt3d-x pt) tick-size) (pt3d-y pt) (pt3d-z pt)))
           (rp (create-pt3d (+ (pt3d-x pt) tick-size) (pt3d-y pt) (pt3d-z pt)))
  -
           (np (create-pt3d (pt3d-x pt) (pt3d-y pt) (+ (pt3d-z pt) tick-size)))
           (fp (create-pt3d (pt3d-x pt) (pt3d-y pt) (- (pt3d-z pt) tick-size))))
  -    (draw-line3d canvas mat tp bp xmin xmax ymin ymax width height)
  -    (draw-line3d canvas mat lp rp xmin xmax ymin ymax width height)
  -    (draw-line3d canvas mat np fp xmin xmax ymin ymax width height)))
  +    (draw-line3d canvas mat tp bp)
  +    (draw-line3d canvas mat lp rp)
  +    (draw-line3d canvas mat np fp)))
   
   (defun random-pt3d (&optional (sz 8.0))
     (ltk3d:create-pt3d (- (random sz) (/ sz 2.0)) (- (random sz) (/ sz 2.0))
  
positive.code: 
  ;; Convienence function to create a pt3d with x,y,z and possible w values
  ;; (declaim (inline create-pt3d))
  (defun create-pt3d (x y z &optional (w 1.0))
    (declare (type single-float x y z w))
    (the pt3d (make-pt3d :pt (make-array 4 :element-type 'single-float :initial-contents (list x y z w)))))
  
  (declaim (inline get-pt))
  (defun get-pt (pt idx)
  
negative.code:                           0.0 0.0 (- near far) 0.0
                            0.0 0.0 0.0 1.0))
             
             ;; (ntrans (mat-mul (rotate-z (/ pi 1.2)) (mat-mul screen-trans (mat-mul (rotate-y (/ pi 4)) trans))))
             (ntrans (mat-mul (translate (- (* 2.0 pi)) 0 (- (* 2.0 pi))) (mat-mul (rotate-x (/ pi 5)) (mat-mul (rotate-z (/ pi 5)) (mat-mul (rotate-y (/ pi 5))  (mat-mul screen-trans trans)))))))
  
        (let* ((xmin 0.0)
               (xmax (* pi 4))
               (ymin 0.0)
               (ymax (* pi 4))
               (xsteps 50)
               (ysteps 50)
               (dx (/ (- xmax xmin) xsteps))
               (dy (/ (- ymax ymin) ysteps))
               (cx xmin)
               (cy ymin))
          (flet ((fxy (xv yv)
                   (* 4.0 (sin xv) (cos yv))))
          
            (loop for i below xsteps
               do
                 (loop for j below ysteps
                    do
                      (let* ((cx (+ xmin (* dx i)))
                             (cy (+ ymin (* dy j)))
                             (p1 (create-pt3d cx (fxy cx cy) cy))
                             (p2 (create-pt3d (+ cx dx) (fxy (+ cx dx) cy) cy))
                             (p3 (create-pt3d (+ cx dx) (fxy (+ cx dx) (+ cy dy)) (+ cy dy)))
                             (p4 (create-pt3d cx (fxy cx (+ cy dy)) (+ cy dy))))
                        (draw-quad canv ntrans p1 p2 p3 p4))))))
               ;;                      (let ((xp (create-pt3d (coerce i 'single-float) 0.0 0.0))
               ;;     (yp (create-pt3d 0.0 (coerce i 'single-float) 0.0))
               ;;     (zp (create-pt3d 0.0 0.0 (coerce i 'single-float))))
               ;; (draw-pt3d canv ntrans xp)
               ;; (draw-pt3d canv ntrans yp)
               ;; (draw-pt3d canv ntrans zp)))
        
        (ltk:pack canv))))
  
  (declaim (inline tol-equal))
  