Skip to content

geosquare/line-segments-intersect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#line-segments-intersect Determine if two line segments intersect each other.

installation

npm install line-segments-intersect

usage

var intersects = require('line-segments-intersect');
intersects(segment1,segment2 [,precision]);

segment1 array of two points
segment2 array of two points
whereas point is array of x and y coordinates
precision after decimal places, default is 6

example

var intersects = require('line-segments-intersect');
if (intersects([[0,0],[10,10]], [[10,0],[0,10]]) {
  console.log('two segments intersect');
}

reference

Intersection point for internal calculation is calculated as given here

developing

Once you run

npm isntall

then for running test

npm run test

to create build

npm run build

license

This project is licensed under the terms of the MIT license.

About

Determine if two line segments intersect each other.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published