is-triangle
v0.1.0
Published
return whether an array of points (in any dimension) describe a triangle
Downloads
11
Maintainers
Readme
is-triangle
Return whether an array of 3 points describe a triangle.
example
var isTriangle = require('is-triangle');
console.log(istriangle([ [ 3, 0 ], [ 4, 1 ], [ 5, 2 ] ])); // false
console.log(istriangle([ [ 3, 0 ], [ 4, -2 ], [ 5, 2 ] ])); // true
methods
var isTriangle = require('is-triangle');
isTriangle(pts, opts={})
Return whether the array of pts
is a triangle, in any dimension.
pts
is an array array coordinates.
Optionally you can control the tolerance for equality comparisons with
opts.tolerance
. The default tolerance is 1e-10
.
install
With npm do:
npm install is-triangle
license
MIT