Skip to main content

smootherstep

Function smootherstep 

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

Smootherstep: C2 interpolation with zero derivatives at both ends.

t assumed within [0, 1]. Formula: 6t^5 - 15t^4 + 10t^3.

ยงExamples

use mathverse_core::ops::smootherstep;

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