diff --git a/libs/math/include/psemek/math/math.hpp b/libs/math/include/psemek/math/math.hpp index d29f14f9..f3e598ea 100644 --- a/libs/math/include/psemek/math/math.hpp +++ b/libs/math/include/psemek/math/math.hpp @@ -225,4 +225,10 @@ namespace psemek::math return x * x * x * (10 - x * (15 - 6 * x)); } + template + T inverse_smoothstep(T x) + { + return T{1} / T{2} - std::sin(std::asin(T{1} - T{2} * x) / T{3}); + } + }