aboutsummaryrefslogtreecommitdiff
path: root/src/model/vec2.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/vec2.ts')
-rw-r--r--src/model/vec2.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/model/vec2.ts b/src/model/vec2.ts
new file mode 100644
index 0000000..4bec53d
--- /dev/null
+++ b/src/model/vec2.ts
@@ -0,0 +1,15 @@
+export interface Vec2 {
+ x: number,
+ y: number,
+}
+
+export function zero(): Vec2 {
+ return {
+ x: 0,
+ y: 0,
+ }
+}
+
+export function equals(v1: Vec2, v2: Vec2): boolean {
+ return v1.x === v2.x && v1.y === v2.y
+}