fn find_slice_average(&self, first_x : f32, last_x : f32) -> f32 {
        let mut count = 0;
        let mut sum = 0.0;
        let from_i = self.i_of(first_x);
        let to_i = self.i_of(last_x);
        for i in from_i..to_i+1 {
            count+=1;
            sum += self.f_of_i(i);
        }
        if count == 0 {
            return self.f_of(first_x)
        } else {
            sum / (count as f32)
        }
    }
// Finds the average value of y values between two x values inclusive
Finds the average value of y values between two x values inclusive
Finds the average value of y values between two x values inclusive
fn find_slice_average(&self, first_x : f32, last_x : f32) -> f32 {
        let mut count = 0;
        let mut sum = 0.0;
        let from_i = self.i_of(first_x);
        let to_i = self.i_of(last_x);
        for i in from_i..to_i+1 {
            count+=1;
            sum += self.f_of_i(i);
        }
        if count == 0 {
            return self.f_of(first_x)
        } else {
            sum / (count as f32)
        }
    }
fn find_slice_average ( & self , first_x : f32 , last_x : f32 ) -> f32 { let mut count = 0 ; let mut sum = 0.0 ; let from_i = self . i_of ( first_x ) ; let to_i = self . i_of ( last_x ) ; for i in from_i .. to_i + 1 { count += 1 ; sum += self . f_of_i ( i ) ; } if count == 0 { return self . f_of ( first_x ) } else { sum / ( count as f32 ) } }
Finds the average value of y values between two x values inclusive
Finds the average value of y values between two x values inclusive
&self
first_x
f32
last_x
f32
&self
first_x
f32
last_x
f32