JSPM

exact-segment-intersect

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2721
  • Score
    100M100P100Q131612F
  • License MIT

Exactly constructs the intersection of two line segments

Package Exports

  • exact-segment-intersect

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (exact-segment-intersect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

exact-segment-intersection

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-intersection")

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

API

require("exact-segment-intersection")(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