aboutsummaryrefslogtreecommitdiff
path: root/src/model/size.ts
diff options
context:
space:
mode:
authorJoris2022-07-05 22:11:00 +0200
committerJoris2022-07-05 22:11:00 +0200
commit8c1ab4c5756ac43d52bc8773f5e72dde90f79e77 (patch)
treede0db8c859e4204c90ddaa762f4d743fab1dedb2 /src/model/size.ts
parent1d855b7a50b61650f7ddf40f604c788de1c9e914 (diff)
WIP
Diffstat (limited to 'src/model/size.ts')
-rw-r--r--src/model/size.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/model/size.ts b/src/model/size.ts
new file mode 100644
index 0000000..5e8a778
--- /dev/null
+++ b/src/model/size.ts
@@ -0,0 +1,8 @@
+export interface Size {
+ width: number,
+ height: number,
+}
+
+export function diagonal(size: Size): number {
+ return Math.sqrt(size.width ** 2 + size.height ** 2)
+}