Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/exact-segment-intersect
Exactly constructs the intersection of two line segments
https://github.com/mikolalysenko/exact-segment-intersect
Last synced: about 2 months ago
JSON representation
Exactly constructs the intersection of two line segments
- Host: GitHub
- URL: https://github.com/mikolalysenko/exact-segment-intersect
- Owner: mikolalysenko
- License: mit
- Created: 2014-06-04T21:49:31.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-27T20:36:38.000Z (over 9 years ago)
- Last Synced: 2024-10-19T00:19:23.181Z (2 months ago)
- Language: JavaScript
- Size: 162 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
exact-segment-intersect
==========================
Exactly computes the intersection of a pair of line segments as a homogeneous vector of non-overlapping increasing sequences.[![testling badge](https://ci.testling.com/mikolalysenko/exact-segment-intersect.png)](https://ci.testling.com/mikolalysenko/exact-segment-intersect)
[![build status](https://secure.travis-ci.org/mikolalysenko/exact-segment-intersect.png)](http://travis-ci.org/mikolalysenko/exact-segment-intersect)
# Example
```javascript
var exactIntersect = require("exact-segment-intersect")var a = [-1,0]
var b = [1,0]
var c = [0,-1]
var d = [0,1]console.log(exactIntersect(a, b, c, d))
```Output:
```javascript
[ [0], [0], [1] ]
```# Install
```
npm install exact-segment-intersect
```# API
#### `require("exact-segment-intersect")(a,b,c,d)`
Exactly computes the intersection of the line segments `[a,b]` and `[c,d]`* `a,b` are the vertices of the first segment
* `c,d` are the vertices of the second segment**Returns** A homogeneous 3 vector encoding the exact point of intersection
# Credits
(c) 2014 Mikola Lysenko. MIT License