Add math::inverse_smoothstep
This commit is contained in:
parent
4c16594b3f
commit
4f4e86ce4f
1 changed files with 6 additions and 0 deletions
|
|
@ -225,4 +225,10 @@ namespace psemek::math
|
|||
return x * x * x * (10 - x * (15 - 6 * x));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T inverse_smoothstep(T x)
|
||||
{
|
||||
return T{1} / T{2} - std::sin(std::asin(T{1} - T{2} * x) / T{3});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue