aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-23 23:11:42 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-23 23:11:42 -0500
commita59b6c0cfdeb469cecb00648cf6b3c03627322b8 (patch)
treec8bed9dceb150d630ef3eddf2ede5d79e06f571e /tests
parent6c912dc1511c7eb17b2c2ff43c1023e8fb9aff78 (diff)
added vec.js
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)));