Skip to content

Commit 2e0b50e

Browse files
committed
Simplified implementations of SmoothStepInterpolation and SmootherStepInterpolation.
1 parent 2f3c35c commit 2e0b50e

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/math/interpolation/SmoothStepInterpolation.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ var SmoothStep = require('../SmoothStep');
2121
*/
2222
var SmoothStepInterpolation = function (x, min, max)
2323
{
24-
var t = SmoothStep(min + (max - min) * x, min, max);
25-
26-
return min + (max - min) * t;
24+
return min + (max - min) * SmoothStep(x, 0, 1);
2725
};
2826

2927
module.exports = SmoothStepInterpolation;

src/math/interpolation/SmootherStepInterpolation.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ var SmootherStep = require('../SmootherStep');
2121
*/
2222
var SmootherStepInterpolation = function (x, min, max)
2323
{
24-
var t = SmootherStep(min + (max - min) * x, min, max);
25-
26-
return min + (max - min) * t;
24+
return min + (max - min) * SmootherStep(x, 0, 1);
2725
};
2826

2927
module.exports = SmootherStepInterpolation;

0 commit comments

Comments
 (0)