smoothstep

\(\begin{align} & \text{clamp}(x) = \min(\max(x,0),1) \\ & \text{unlerp}(f_x,f_0,f_1) = \dfrac{f_x-f_0}{f_1-f_0} \\ & t = \text{clamp}(\text{unlerp}(x,e_1,e_2)) \\ & \text{smoothstep}(x,e_1,e_2) = \begin{cases} 3t^2-2t^3 &\text{if }e_1 \ne e_2 \\ \lfloor x+1-e_1 \rfloor &\text{else} \end{cases} \end{align}\)

Join the PuzzleAndy Discord