exact-segment-intersect

2.0.0 • Public • Published

exact-segment-intersect

Exactly computes the intersection of a pair of line segments as a homogeneous vector of non-overlapping increasing sequences.

testling badge

build status

Example

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:

[ [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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1,587
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1,587
  • 1.0.0
    0

Package Sidebar

Install

npm i exact-segment-intersect

Weekly Downloads

1,587

Version

2.0.0

License

MIT

Last publish

Collaborators

  • mikolalysenko