Skip to content

Commit 220742a

Browse files
committed
Fixes accidental ctrl+z before publishing; TGIF
1 parent 150341d commit 220742a

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/interpolate/splineMonotone.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const monotone = (y_im1, y_i, y_ip1, y_ip2, h, t) => {
3737
min(abs(s_i), abs(s_ip1), 0.5 * abs((y_ip2 - y_i) / (2 * h)));
3838

3939
return (
40-
((yp_i + yp_ip1 - 2 * si) / h2) * t3 +
41-
((3 * si - 2 * yp_i - yp_ip1) / h) * t2 +
40+
((yp_i + yp_ip1 - 2 * s_i) / h2) * t3 +
41+
((3 * s_i - 2 * yp_i - yp_ip1) / h) * t2 +
4242
yp_i * t +
4343
y_i
4444
);
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import tape from 'tape';
2+
import { samples, interpolateSplineMonotone } from '../src/index';
3+
4+
tape('interpolateSplineMonotone', t => {
5+
let data = [3, 2.8, 2.5, 1, 0.95, 0.8, 0.5, 0.1, 0.05];
6+
t.deepEqual(samples(10).map(interpolateSplineMonotone()(data)), [
7+
3,
8+
2.826611796982167,
9+
2.6089163237311386,
10+
1.3592592592592596,
11+
0.973593964334705,
12+
0.8984224965706447,
13+
0.7148148148148149,
14+
0.40631001371742104,
15+
0.09005486968449936,
16+
0.049999999999999975
17+
]);
18+
19+
t.end();
20+
});

0 commit comments

Comments
 (0)