anchor.diff:           (cl:+ xy wz)            (cl:- 1.0 (cl:+ xx zz)) (cl:- yz wx)
            (cl:- xz wy)            (cl:+ yz wx)            (cl:- 1.0 (cl:+ xx yy)))))))
   
  -(defun to-mat4 (quat)
  +(defn to-mat4 ((quat quaternion)) mat4
  +  (declare (optimize (speed 3) (safety 1) (debug 1)))
     (let ((w (w quat))  (x (x quat))  (y (y quat))  (z (z quat)))
       (let ((x2 (cl:+ x x)) (y2 (cl:+ y y)) (z2 (cl:+ z z)))
         (let ((wx (cl:* w x2))  (wy (cl:* w y2))  (wz (cl:* w z2))
  
positive.code:          (up (v3:cross n-dir n-right)))
      (q:from-axies n-right up n-dir)))
  
  (defun to-look-at (quat)
    (let ((v (v3:make 0s0 0s0 -1s0)))
      (m3:*v (to-mat3 quat) v)))
  
  (defun to-look-at-vec4 (quat)
    (let ((v (v4:make 0s0 0s0 -1s0 0s0)))
      (m4:*v (to-mat4 quat) v)))
  
  (defun from-fixed-angles (x-rot y-rot z-rot)
    (let ((x-rot (/ x-rot 2.0))
          (y-rot (/ y-rot 2.0))
          (z-rot (/ z-rot 2.0)))
  
negative.code:           (cl:- (cl:* cos-x sin-y cos-z) (cl:* sin-x cos-y sin-z))
            (cl:- (cl:* cos-x cos-y sin-z) (cl:* sin-x sin-y cos-x))))))
  
  (defn magnitude ((quat quaternion)) single-float
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (let ((w (w quat)) (x (x quat)) (y (y quat)) (z (z quat)))
      (sqrt (cl:+ (cl:* w w) (cl:* x x) (cl:* y y) (cl:* z z)))))
  
  (defn norm ((quat quaternion)) single-float
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (let ((w (w quat)) (x (x quat)) (y (y quat)) (z (z quat)))
      (cl:+ (cl:* w w) (cl:* x x) (cl:* y y) (cl:* z z))))
  
  (defn = ((q1 quaternion) (q2 quaternion)) boolean
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (and (cl:= 0f0 (cl:- (w q2) (w q1)))
  	   (cl:= 0f0 (cl:- (x q2) (x q1)))
         (cl:= 0f0 (cl:- (y q2) (y q1)))
  	   (cl:= 0f0 (cl:- (z q2) (z q1)))))
  
  (defn /= ((q1 quaternion) (q2 quaternion)) boolean
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (not (or (cl:= 0f0 (cl:- (w q2) (w q1)))
  		   (cl:= 0f0 (cl:- (x q2) (x q1)))
  		   (cl:= 0f0 (cl:- (y q2) (y q1)))
  		   (cl:= 0f0 (cl:- (z q2) (z q1))))))
  
  (defn copy ((quat quaternion)) quaternion
    (declare (optimize (speed 3) (safety 1) (debug 1)))
    (q! (w quat) (x quat) (y quat) (z quat)))
  
  (defn get-axis-angle ((quat quaternion)) list
    ;;(declare (optimize (speed 3) (safety 1) (debug 1)))
    (list
     (let ((length (sqrt (cl:- 1.0 (cl:* (w quat) (w quat))))))
       (if (cl:= 0f0 length)
  