aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-19 02:37:08 -0400
committerbobzel <zzzman@gmail.com>2024-05-19 02:37:08 -0400
commitac4dbfff647c5ce6e98c6a8f8726f6674e45be7d (patch)
treec47b58c347deda615581eb44bed955396f30f31f /src/Utils.ts
parent33f51c59f5f75ff7e19eb3f47184685668596f8b (diff)
parent2ab3fd16d01863300bcdb1cf076b6f5c81daf867 (diff)
Merge branch 'eleanor-starter' into restoringEslint
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 3af057d82..44f1d55c2 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -3,6 +3,11 @@ import * as uuid from 'uuid';
export function clamp(n: number, lower: number, upper: number) {
return Math.max(lower, Math.min(upper, n));
}
+
+export function ptDistance(p1: { x: number; y: number }, p2: { x: number; y: number }) {
+ return Math.sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2);
+}
+
export namespace Utils {
export function GuestID() {
return '__guest__';