aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-06-28 11:47:41 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-06-28 11:47:41 -0400
commitb6537cce6aa34eb33c052d7ec2cbbf804be08fba (patch)
tree34ee9ff83af71359ce6a0cc17d5a711db7780fa1 /src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts
parenta6181a5695c7355b7996ac6c6c1e7aad886e6302 (diff)
added files
Diffstat (limited to 'src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts')
-rw-r--r--src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts b/src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts
new file mode 100644
index 000000000..027b99a52
--- /dev/null
+++ b/src/client/views/nodes/generativeFill/generativeFillUtils/GenerativeFillMathHelpers.ts
@@ -0,0 +1,11 @@
+import { Point } from "./generativeFillInterfaces";
+
+export class GenerativeFillMathHelpers {
+ // math helpers
+ static distanceBetween = (p1: Point, p2: Point) => {
+ return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
+ };
+ static angleBetween = (p1: Point, p2: Point) => {
+ return Math.atan2(p2.x - p1.x, p2.y - p1.y);
+ };
+}