
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
intersection
Advanced tools
var intersection = require('intersection');
var seg2 = {start:{x:-1,y:2}, end:{x:5,y:2}};
var seg3 = {start:{x:1,y:-1}, end:{x:4,y:4}};
intersection.intersect(seg2,seg3);
// {x:2.8,y:2}
.intersect(a,b) takes two line segments a and b and returns their point of intersection. Returns false if they are collinear or parallel.
.describe(a,b) takes two line segments a and b and returns a report about thier co-linearity, if they are parallel, and the intersection if defined.
var segA = {start:{x:3,y:0},end:{x:3,y:4}};
// colinear with segA
var segA_1 = {start:{x:3,y:-2},end:{x:3, y:9}};
// parallel but not colinear with seg1
var segA_2 = {start:{x:1, y:-1}, end:{x:1, y:5}};
intersection.describe(segA,segA_1);
// {colinear:true, parallel:true,intersection:undefined}
intersection.describe(segA,segA_2);
// {colinear:false, parallel:true,intersection:undefined}
intersection.describe(segA,segB);
// {colinear:false, parallel:false, intersection:{x:2.8,y:2}
Returns true if a and b are parallel line segments, false otherwise.
Returns true if a and b are collinear line segments, false otherwise. Collinear segments means the segments lie on the same line.
.intersect returns false if the two segments are co-linear or parallel.
Intersection utilizes the fast cross-product method as outlined by Ronald Grahm in "Graphics Gems I".
From nodeunit test/test.js
nodeunit test.js
test.js
✔ descriptionTest
✔ basicTest
✔ safeIntersectionTest
✔ testReadmeExamples
OK: 13 assertions (21ms)
There is a speed boost outlined by Mukesh Prasad in "Graphics Gems II" utilizing a same-side sign test.
FAQs
fast line intersection
We found that intersection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.