Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
slab-decomposition
Advanced tools
Readme
Given a collection of line segments, constructs a slab decomposition for the purpose of point location queries. This implementation uses a functional red-black tree to store the slabs, requires O(n log(n)) space and answers vertical ray queries in O(log(n)) time.
var makeSlab = require("slab-decomposition")
var slabs = makeSlab([
[[0, 0], [10, 10]],
[[10,10], [20, 0]],
[[5, 5], [20, 0]]
])
for(var i=-10; i<10; ++i) {
console.log(slabs.castUp([i, -1]))
}
npm install slab-decomposition
var slabs = require("slab-decomposition")(segments)
Constructs a slab decomposition from the segments
segments
is a collection of line segments which only overlap at their end pointsReturns A slab decomposition data structure
slabs.castUp(point)
Casts a vertical ray from point
going upward along [0,1]
. Returns the index of the first segment hit.
point
is the base point of the rayReturns The index of the first segment hit by point, otherwise -1 if no segment intersects the ray.
(c) 2014 Mikola Lysenko. MIT License
FAQs
Slab decomposition data structure for 2D vertical ray queries
The npm package slab-decomposition receives a total of 67,758 weekly downloads. As such, slab-decomposition popularity was classified as popular.
We found that slab-decomposition 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.