From 8c1ab4c5756ac43d52bc8773f5e72dde90f79e77 Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 5 Jul 2022 22:11:00 +0200 Subject: WIP --- src/model/size.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/model/size.ts (limited to 'src/model/size.ts') 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) +} -- cgit v1.2.3