summaryrefslogtreecommitdiff
path: root/frontend/util/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-07 19:50:45 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-07 19:50:45 +0200
commit17849826f610365a2d4225cc0382d5168aae399b (patch)
tree8ebc09c4afafba814da1ce64ad23a5cd0e4b2948 /frontend/util/index.js
parentadf56057ff4f56d8a3b7c1e82422a62a0b047d21 (diff)
control spacing of these divs
Diffstat (limited to 'frontend/util/index.js')
-rw-r--r--frontend/util/index.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/frontend/util/index.js b/frontend/util/index.js
index 4a6cef8..194ecf0 100644
--- a/frontend/util/index.js
+++ b/frontend/util/index.js
@@ -69,6 +69,7 @@ export const px = (n, w) => Math.round(n * w) + 'px'
export const clamp = (n, a=0, b=1) => n < a ? a : n < b ? n : b
export const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))
export const mod = (n, m) => n - (m * Math.floor(n / m))
+export const angle = (x1, y1, x2, y2) => Math.atan2(y2 - y1, x2 - x1)
/* URLs */