0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

Add missing divide function to point reladed utils.

This commit is contained in:
Andrey Antukh 2016-04-05 22:27:58 +03:00
parent 38509eea99
commit c2126b6fe4

View file

@ -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]