summaryrefslogtreecommitdiff
path: root/src/modules/Geometry.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-05-30 18:19:02 -0500
committersanine <sanine.not@pm.me>2022-05-30 18:19:02 -0500
commit8aa6645f2311de78f74b35f804cc45c7fcf38f57 (patch)
tree95107aedc3305ef11526ef8dd846c249cc356cdb /src/modules/Geometry.js
parent9ccb4a7bc728fd0e85c04fddb802fde02b73cfe2 (diff)
add brushesmain
Diffstat (limited to 'src/modules/Geometry.js')
-rw-r--r--src/modules/Geometry.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/Geometry.js b/src/modules/Geometry.js
index 628512b..43f277f 100644
--- a/src/modules/Geometry.js
+++ b/src/modules/Geometry.js
@@ -1,5 +1,9 @@
'use strict';
+function dist(a, b) {
+ return Math.sqrt((a.x - b.x)**2 + (a.y - b.y)**2);
+}
+
/* AABB - axis-aligned bounding box */
class AABB {
/* create a new AABB */
@@ -226,4 +230,4 @@ class QuadTree {
}
}
-export { AABB, QTNode, QuadTree };
+export { dist, AABB, QTNode, QuadTree };