mathlib-n
Version:
a math library for node.js
6 lines (5 loc) • 319 B
JavaScript
const math = require("../index");
console.log(math.quad([1, 2], [3, 4], [1, -4], [1, 3])); // [-1, -1]
console.log(math.tringle([1, 2], [3, 4], [1, -4])); // [2, 2]
console.log(math.polyArea([1, 2], [3, 4], [1, -4], [1, 3], [4, 9], [7, 3])); // 27
console.log(math.polyArea([1, 2], [3, 4], [1, -4], [1, 3])); // 6