Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function calculatePoints (controls) {
const points = []
let progress = 0
while (progress < 1) {
points.push(bspline(progress, degree, controls))
progress += 0.01
}
return points
}
function calculateSplinePoints (controls, degree) {
const points = []
const granularity = 100
let i = 0
while (i <= granularity) {
const progress = i / granularity
points.push(bspline(progress, degree, controls))
i += 1
}
return points
}