diff options
author | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-23 23:11:42 -0500 |
---|---|---|
committer | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-23 23:11:42 -0500 |
commit | a59b6c0cfdeb469cecb00648cf6b3c03627322b8 (patch) | |
tree | c8bed9dceb150d630ef3eddf2ede5d79e06f571e /tests | |
parent | 6c912dc1511c7eb17b2c2ff43c1023e8fb9aff78 (diff) |
added vec.js
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vec_elem.js | 10 |
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))); |