16 lines
259 B
JavaScript
16 lines
259 B
JavaScript
|
export default function(pp, arg_r) {
|
||
|
var r = 2 * Math.cos(arg_r);
|
||
|
var i = pp.length - 1;
|
||
|
var hr1 = pp[i];
|
||
|
var hr2 = 0;
|
||
|
var hr;
|
||
|
|
||
|
while (--i >= 0) {
|
||
|
hr = -hr2 + r * hr1 + pp[i];
|
||
|
hr2 = hr1;
|
||
|
hr1 = hr;
|
||
|
}
|
||
|
|
||
|
return Math.sin(arg_r) * hr;
|
||
|
}
|