From a59b6c0cfdeb469cecb00648cf6b3c03627322b8 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Mon, 23 Dec 2019 23:11:42 -0500 Subject: added vec.js --- tests/vec_elem.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/vec_elem.js (limited to 'tests') 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))); -- cgit