Gathering detailed insights and metrics for curve-interpolator
Gathering detailed insights and metrics for curve-interpolator
Gathering detailed insights and metrics for curve-interpolator
Gathering detailed insights and metrics for curve-interpolator
Interpolate values over a cubic Cardinal/Catmull-Rom curve
npm install curve-interpolator
Typescript
Module System
Node Version
NPM Version
TypeScript (99.39%)
JavaScript (0.61%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
51 Stars
113 Commits
6 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Mar 29, 2025
Latest Version
3.3.1
Package Id
curve-interpolator@3.3.1
Unpacked Size
185.10 kB
Size
50.63 kB
File Count
30
NPM Version
9.6.5
Node Version
16.19.1
Published on
Nov 22, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
A lib for interpolating values over a cubic Cardinal/Catmull-Rom spline curve of n-dimenesions.
1npm install --save curve-interpolator
Reference the CurveInterpolator class:
1// commonjs 2const CurveInterpolator = require('curve-interpolator').CurveInterpolator; 3 4// es6 5import { CurveInterpolator } from 'curve-interpolator'; 6
Define controlpoints you want the curve to pass through and pass it to the constructor of the CurveInterpolator to create an instance:
1const points = [ 2 [0, 4], 3 [1, 2], 4 [3, 6.5], 5 [4, 8], 6 [5.5, 4], 7 [7, 3], 8 [8, 0], 9 ... 10]; 11 12const interp = new CurveInterpolator(points, { tension: 0.2, alpha: 0.5 }); 13 14// get single point 15const position = 0.3 // [0 - 1] 16const pt = interp.getPointAt(position) 17 18// get points evently distributed along the curve 19const segments = 1000; 20const pts = interp.getPoints(segments); 21 22// lookup values along x and y axises 23const axis = 1; 24const yintersects = interp.getIntersects(7, axis); 25 26/* 27max number of solutions (0 = all (default), 1 = first, -1 = last) 28A negative max value counts solutions from end of curve 29*/ 30const axis = 0; 31const max = -1; 32const xintersects = interp.getIntersects(3.2, axis, max); 33 34// get bounding box 35const bbox = interp.getBoundingBox();
Online example on ObservableHQ:
Docs are generated using typedoc in ./docs
. To create:
1npm run docs
Online: https://kjerandp.github.io/curve-interpolator/
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More