 (defn vec2
   "Make Vec2 vector"
   [x y] (Vec2. x y))
+
+(defn array-vec
+  "Make ArrayVec type"
+  [lst]
+  (ArrayVec. (double-array lst)))

   :econstrain (fn [v val1 val2] (mapv #(m/constrain ^double %1 ^double val1 ^double val2)) v)
   :is-zero? #(every? clojure.core/zero? %)
   :is-near-zero? #(every? near-zero? %)})

;; Create Vec2 and add all necessary protocols
(deftype Vec2 [^double x ^double y]

  (mag [_] (m/hypot x y z))
  (dot [_ v2]
    (let [^Vec3 v2 v2] (+ (* x (.x v2)) (* y (.y v2)) (* z (.z v2)))))
  (add [v] v)
  (add [_ v2] 
    (let [^Vec3 v2 v2] (Vec3. (+ x (.x v2)) (+ y (.y v2)) (+ z (.z v2)))))
  (sub [_] (Vec3. (- x) (- y) (- z)))
