
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
adaptive-quadratic-curve
Advanced tools
Builds a quadratic curve that is adaptive; that is to say, it has more points along curved corners, and less points along straight lines. This can be used to produce scalable curves that are consistently smooth, while using a small number of steps. Based on AntiGrain.
Also see adaptive-bezier-curve.
var quadratic = require('adaptive-quadratic-curve')
var start = [20, 20],
c1 = [100, 159],
end = [200, 20],
scale = 2
var points = quadratic(start, c1, end, scale)
//returns a list of 2d points: [ [x,y], [x,y], [x,y] ... ]
See demo/index.js for an example with HTML5 canvas.
quadratic(start, c1, end[, scale, points])
Returns an adaptive quadratic curve for the given three control points. You can specify a scale
to produce better smoothing for scaled contexts, otherwise it defaults to 1.0.
If you specify a points
array, the new points will be pushed onto that array (useful for building paths). If you don't specify points
, a new array will be used.
The AntiGrain 2.4 code is licensed under BSD-3-Clause, see LICENSE.md for details.
FAQs
adaptive and scalable 2D quadratic curves
We found that adaptive-quadratic-curve 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.