Function iter_num_tools::lin_space[][src]

pub fn lin_space<R, T>(range: R, steps: usize) -> LinSpace<T> where
    (R, usize): Into<LinearInterpolation<T>>, 
Expand description

Creates a linear space over range with a fixed number of steps

use iter_num_tools::lin_space;

// Inclusive
let it = lin_space(20.0..=21.0, 3);
assert!(it.eq(vec![20.0, 20.5, 21.0]));

// Exclusive
let it = lin_space(20.0..21.0, 2);
assert!(it.eq(vec![20.0, 20.5]));