   (abs [v1])
   (mx [v1])
   (mn [v1])
-  (sum [v1])
+  (emx [v1 v2])
+  (emn [v1 v2])
+  (maxdim [v])
+  (mindim [v])
+  (base-from [v])
+  (sum [v1])  
   (interpolate [v1 v2 t] [v1 v2 t f])
   (is-zero? [v1])
   (is-near-zero? [v1])

  [v1 v2]
  (mag (sub v1 v2)))

(defn dist-abs
  "Manhattan distance between vectors"
  [v1 v2]

  (mult [_ v] (Vec3. (* x v) (* y v) (* z v)))
  (emult [_ v] 
    (let [^Vec3 v v] (Vec3. (* x (.x v)) (* y (.y v)) (* z (.z v)))))
  (div [_ v] 
    (let [v1 (/ 1.0 v)] (Vec3. (* x v1) (*  y v1) (* z v1))))
  (abs [_] (Vec3. (m/abs x) (m/abs y) (m/abs z)))
  (mx [_] (max x y z))
  (mn [_] (min x y z))
  (emx [_ v]
    (let [^Vec3 v v] (max (.x v) x) (max (.y v) y) (max (.z v) z)))
  (emn [_ v]
    (let [^Vec3 v v] (min (.x v) x) (min (.y v) y) (min (.z v) z)))
  (maxdim [_]
    (if (> x y)
      (if (> x z) 0 2)
      (if (> y z) 1 2)))
  (mindim [_]
    (if (< x y)
      (if (< x z) 0 2)
      (if (< y z) 1 2)))
  (base-from [v]
    (let [v2 (if (> (m/abs x) (m/abs y))
               (div (Vec3. (- z) 0.0 x) (m/hypot x z))
               (div (Vec3. 0.0 z (- y)) (m/hypot y z)))]
      [v v2 (cross v v2)]))
  (sum [_] (+ x y z)) 
  (interpolate [_ v2 t f]
    (let [^Vec3 v2 v2] (Vec3. (f x (.x v2) t)
