is-triangle

0.1.0 • Public • Published

is-triangle

Return whether an array of 3 points describe a triangle.

testling badge

build status

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

/is-triangle/

    Package Sidebar

    Install

    npm i is-triangle

    Weekly Downloads

    9

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • nopersonsmodules