fn calculate_mean(arr: &Vec<(f32, f32)>) -> (f32, f32) {
    let mut sum_x: f32 = 0.0;
    let mut sum_y: f32 = 0.0;
    let len = arr.len() as f32;
    for i in arr {
        sum_x += i.0;
        sum_y += i.1;
    }
    let mean_x: f32 = sum_x / len;
    let mean_y: f32 = sum_y / len;
    (mean_x, mean_y)
}
///calculate_mean takes in an array of tuples which contain f32 values. These are the X,Y co-ordinates. The mean is calculated on X and Y and a tuple of f32 is returned which contains the mean of X and the mean of Y.
calculate_mean takes in an array of tuples which contain f32 values. These are the X,Y co-ordinates. The mean is calculated on X and Y and a tuple of f32 is returned which contains the mean of X and the mean of Y.
calculate_mean takes in an array of tuples which contain f32 values . These are the X Y co - ordinates . The mean is calculated on X and Y and a tuple of f32 is returned which contains the mean of X and the mean of Y .
fn calculate_mean(arr: &Vec<(f32, f32)>) -> (f32, f32) {
    let mut sum_x: f32 = 0.0;
    let mut sum_y: f32 = 0.0;
    let len = arr.len() as f32;
    for i in arr {
        sum_x += i.0;
        sum_y += i.1;
    }
    let mean_x: f32 = sum_x / len;
    let mean_y: f32 = sum_y / len;
    (mean_x, mean_y)
}
fn calculate_mean ( arr : & Vec < ( f32 , f32 ) > ) -> ( f32 , f32 ) { let mut sum_x : f32 = 0.0 ; let mut sum_y : f32 = 0.0 ; let len = arr . len ( ) as f32 ; for i in arr { sum_x += i . 0 ; sum_y += i . 1 ; } let mean_x : f32 = sum_x / len ; let mean_y : f32 = sum_y / len ; ( mean_x , mean_y ) }
calculate_mean takes in an array of tuples which contain f32 values.
calculate_mean takes in an array of tuples which contain f32 values .
arr
&Vec<(f32, f32)>
arr
&Vec<(f32, f32)>