mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 00:19:07 -05:00
Add missing divide function to point reladed utils.
This commit is contained in:
parent
38509eea99
commit
c2126b6fe4
1 changed files with 7 additions and 0 deletions
|
@ -86,6 +86,13 @@
|
||||||
(Point. (* (:x p) (:x other))
|
(Point. (* (:x p) (:x other))
|
||||||
(* (:y p) (:y 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
|
(defn distance
|
||||||
"Calculate the distance between two points."
|
"Calculate the distance between two points."
|
||||||
[p other]
|
[p other]
|
||||||
|
|
Loading…
Add table
Reference in a new issue