Function textplots::utils::interpolate [−][src]
pub fn interpolate<'a>(
data: &'a [(f32, f32)]
) -> impl Fn(f32) -> f32 + 'a
Transforms points into function using linear interpolation.
assert_eq!(1.0, utils::interpolate( &[ (0.0, 0.0), (10.0, 10.0) ] )(1.0));