Skip to main content

smoothstep

Function smoothstep 

Source
pub fn smoothstep<T: Real>(x: T) -> T
Expand description

Smoothstep: C1 interpolation with zero derivatives at both ends.

x assumed within [0, 1]. Formula: 3t^2 - 2t^3.

ยงExamples

use mathverse_core::ops::smoothstep;

assert_eq!(smoothstep(0.0), 0.0);
assert_eq!(smoothstep(0.5), 0.5);
assert_eq!(smoothstep(1.0), 1.0);