aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/vec_elem.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/vec_elem.js b/tests/vec_elem.js
new file mode 100644
index 0000000..f364681
--- /dev/null
+++ b/tests/vec_elem.js
@@ -0,0 +1,10 @@
+// Tests vec.js, in its main functionality---.elem()
+
+const vec = require('../utils/vec');
+
+coord1 = [-22, 23];
+coord2 = [25, 25];
+
+console.log('add', vec.add(coord1, coord2));
+console.log('sub', vec.sub(coord1, coord2));
+console.log('min', vec.elem(coord1, coord2, (a,b) => Math.min(a,b)));