pub fn smoothstep_between<T: Real>(edge0: T, edge1: T, x: T) -> TExpand description
Parameterized smoothstep: C1 interpolation between edge0 and edge1.
Returns 0 when x <= edge0, 1 when x >= edge1, and a smooth
Hermite interpolation between them otherwise.
Formula: t = clamp((x - edge0) / (edge1 - edge0), 0, 1),
result: t^2 * (3 - 2t).
ยงExamples
use mathverse_core::ops::smoothstep_between;
assert_eq!(smoothstep_between(0.0, 1.0, 0.0), 0.0);
assert_eq!(smoothstep_between(0.0, 1.0, 0.5), 0.5);
assert_eq!(smoothstep_between(0.0, 1.0, 1.0), 1.0);
assert_eq!(smoothstep_between(2.0, 5.0, 3.5), 0.5);
assert_eq!(smoothstep_between(0.0, 1.0, -1.0), 0.0);
assert_eq!(smoothstep_between(0.0, 1.0, 2.0), 1.0);