fix step/resolution logic and fix accuracy issues

This commit is contained in:
Simon Gardling
2022-05-16 10:53:17 -04:00
parent bee782035e
commit 73cb36cb50
4 changed files with 4 additions and 28 deletions

View File

@@ -299,13 +299,6 @@ where
.concat()
}
/// Returns a vector of length `max_i` starting at value `min_x` with resolution of `resolution`
pub fn resolution_helper(max_i: usize, min_x: &f64, resolution: &f64) -> Vec<f64> {
(0..max_i)
.map(|x| (x as f64 / resolution) + min_x)
.collect()
}
/// Returns a vector of length `max_i` starting at value `min_x` with step of `step`
pub fn step_helper(max_i: usize, min_x: &f64, step: &f64) -> Vec<f64> {
(0..max_i).map(|x| (x as f64 * step) + min_x).collect()