https://github.com/flekschas/line-seg-intersect
Fast testing whether two line segments intersect
https://github.com/flekschas/line-seg-intersect
2d intersection line-segment lines spatial
Last synced: 6 months ago
JSON representation
Fast testing whether two line segments intersect
- Host: GitHub
- URL: https://github.com/flekschas/line-seg-intersect
- Owner: flekschas
- License: mit
- Created: 2018-09-25T19:07:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T20:57:13.000Z (over 7 years ago)
- Last Synced: 2025-10-24T03:59:43.763Z (6 months ago)
- Topics: 2d, intersection, line-segment, lines, spatial
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Line Segment Intersection
[](https://www.npmjs.com/package/line-seg-intersect)
[](https://travis-ci.org/flekschas/line-seg-intersect)
[](https://github.com/prettier/prettier)
> Fast testing whether two line segments intersect
## Install
```
npm i line-seg-intersect
```
## API
### `const isIntersecting = lineSegIntersect(x1, x2, x3, x4, y1, y2, y3, y4)`
Checks if two line segments `(x1,y1)-(x2,y2)` and `(x3,y3)-(x4,y4)` are intersecting.
**Returns** `true` if the two line segments intersect.