From c2126b6fe42f660e7b30b4d28d99e0bc4b7f0be6 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 5 Apr 2016 22:27:58 +0300 Subject: [PATCH] Add missing divide function to point reladed utils. --- src/uxbox/util/geom/point.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/uxbox/util/geom/point.cljs b/src/uxbox/util/geom/point.cljs index ce5f4efe4f..a5de1f4c4f 100644 --- a/src/uxbox/util/geom/point.cljs +++ b/src/uxbox/util/geom/point.cljs @@ -86,6 +86,13 @@ (Point. (* (:x p) (:x other)) (* (:y p) (:y other))))) +(defn divide + [p other] + {:pre [(point? p)]} + (let [other (-point other)] + (Point. (/ (:x p) (:x other)) + (/ (:y p) (:y other))))) + (defn distance "Calculate the distance between two points." [p other]