UNPKG
jmod
Version:
latest (0.4.0)
0.4.0
0.3.0
0.2.0
audio / dsp enveloping with some added features
github.com/NHQ/jmod
jmod
/
deCasteljau.js
10 lines
(9 loc)
•
273 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
module
.
exports
=
function
(
pts
) {
return
function
(
t
) {
for
(
var
a = pts; a.
length
>
1
; a = b)
for
(
var
i =
0
, b = [], j; i < a.
length
-
1
; i++)
for
(b[i] = [], j =
0
; j < a[i].
length
; j++) b[i][j] = a[i][j] * (
1
- t) + a[i+
1
][j] * t;
return
a[
0
]; } }