Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

robust-segment-intersect

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robust-segment-intersect

Exact arithmetic test for line segment intersection

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by2.6%
Maintainers
1
Weekly downloads
 
Created
Source

robust-segment-intersect

Exact arithmetic predicate to determine if two closed linesegments intersect.

testling badge

build status

Example


var crosses = require("robust-segment-intersect")

var a0 = [-1, 0]
var a1 = [ 1, 0]
var b0 = [ 0,-1]
var b1 = [ 0, 1]

//Check if line segment a0, a1  crosses segment b0, b1
console.log(crosses(a0, a1, b0, b1))

Install

npm install robust-segment-intersect

API

require("robust-segment-intersect")(a0, a1, b0, b1)

Tests if the closed line segment [a0,a1] intersects the closed line segment [b0,b1].

  • a0, a1 are the end points of the first line segment encoded as length 2 arrays
  • b0, b1 are the end points of the second line segment encoded again as length 2 arrays

Returns true if the linesegments intersect, false otherwise

Credits

(c) 2014 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 04 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc