Skip to content

Commit

Permalink
Switch interpolatorSplineMonotone and interpolatorSplineMonotone2
Browse files Browse the repository at this point in the history
  • Loading branch information
danburzo committed Aug 24, 2020
1 parent d58d4de commit b3d3d5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/interpolate/splineMonotone.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const interpolator = (arr, yp, s) => {
};
};

const interpolatorSplineMonotone2 = arr => {
const interpolatorSplineMonotone = arr => {
if (arr.length < 3) {
return interpolatorLinear(arr);
}
Expand All @@ -82,7 +82,7 @@ const interpolatorSplineMonotone2 = arr => {
linear interpolation.
*/

const interpolatorSplineMonotone = arr => {
const interpolatorSplineMonotone2 = arr => {
if (arr.length < 3) {
return interpolatorLinear(arr);
}
Expand Down
12 changes: 6 additions & 6 deletions test/interpolateSplineMonotone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ tape('interpolatorSplineMonotone', t => {
let data = [3, 2.8, 2.5, 1, 0.95, 0.8, 0.5, 0.1, 0.05];
t.deepEqual(samples(10).map(interpolatorSplineMonotone(data)), [
3,
2.82716049382716,
2.826611796982167,
2.6089163237311386,
1.3592592592592596,
0.973593964334705,
0.8984224965706447,
0.7148148148148149,
0.40631001371742104,
0.08950617283950621,
0.04999999999999999
0.09005486968449936,
0.049999999999999975
]);
t.end();
});
Expand All @@ -28,15 +28,15 @@ tape('interpolatorSplineMonotone2', t => {
let data = [3, 2.8, 2.5, 1, 0.95, 0.8, 0.5, 0.1, 0.05];
t.deepEqual(samples(10).map(interpolatorSplineMonotone2(data)), [
3,
2.826611796982167,
2.82716049382716,
2.6089163237311386,
1.3592592592592596,
0.973593964334705,
0.8984224965706447,
0.7148148148148149,
0.40631001371742104,
0.09005486968449936,
0.049999999999999975
0.08950617283950621,
0.04999999999999999
]);
t.end();
});
Expand Down

0 comments on commit b3d3d5f

Please sign in to comment.