         ;; touches aren't seqable
         (js/Array.prototype.slice.call touches)))
 
+(defn measure [[x1 y1] [x2 y2]]
+  (Math/sqrt (+ (Math/pow (- x2 x1) 2)
+                (Math/pow (- y2 y1) 2))))
+
+(defn center [[x1 y1] [x2 y2]]
+  [(/ (+ x2 x1) 2)
+   (/ (+ y2 y1) 2)])
+
 (defn svg-canvas [payload owner opts]
   (reify
     om/IInitState (init-state [_]

                                            (cast! :cancel-drawing)
                                            (reset! (om/get-state owner :touches) (touches->clj touches)))

                                          :else nil)))
                      :onTouchEnd (fn [event]
                                    (.preventDefault event)
                                    (js/clearInterval (om/get-state owner :touch-timer))

                                          (= (.-length touches) 1)
                                          (do
                                            (.preventDefault event)
                                            (js/clearInterval (om/get-state owner :touch-timer))
                                            (om/set-state! owner :touch-timer (js/setTimeout #(cast! :menu-opened) 500))
                                            ((:handle-mouse-down handlers) (aget touches "0")))

