fn fill_output_buffer_from_point_list(output: & mut Vec<char>, point_list: & Vec<(f32, f32)>) {
   
    let mut max_x: i32 = -1;
    let mut max_y: i32 = -1;
    for (x, y) in point_list {
        println!("val de input x: {}, y: {}", x, y);
        if     (*x >= -1.0 && *x <= 1.0) 
           &&  (*y >= -1.0 && *y <= 1.0) { 

            let new_x = ( ( ( x + 1.0 ) / 2.0 ) * (SCREEN_WIDTH - 1.0)) as i32;            
            let new_y = ( ( ( y + 1.0 ) / 2.0) * (SCREEN_HEIGHT - 1.0 )) as i32;

            if new_x > max_x {
                max_x = new_x;
            }
            if new_y > max_y {
                max_y = new_y;
            }
            
            println!(" val output x: {}, y: {}", new_x, new_y);
            output[lin_pos(new_x as usize, new_y as usize)] = '*';
        }
    }    

    println!("MAX x: {}, y: {}", max_x, max_y);
}
/// Fill the output Vec with the Rust 2D PNG
Fill the output Vec with the Rust 2D PNG
Fill the output Vec with the Rust 2D PNG
fn fill_output_buffer_from_point_list(output: & mut Vec<char>, point_list: & Vec<(f32, f32)>) {
    let mut max_x: i32 = -1;
    let mut max_y: i32 = -1;
    for (x, y) in point_list {
        println!("val de input x: {}, y: {}", x, y);
        if     (*x >= -1.0 && *x <= 1.0) 
           &&  (*y >= -1.0 && *y <= 1.0) { 
            let new_x = ( ( ( x + 1.0 ) / 2.0 ) * (SCREEN_WIDTH - 1.0)) as i32;            
            let new_y = ( ( ( y + 1.0 ) / 2.0) * (SCREEN_HEIGHT - 1.0 )) as i32;
            if new_x > max_x {
                max_x = new_x;
            }
            if new_y > max_y {
                max_y = new_y;
            }
            println!(" val output x: {}, y: {}", new_x, new_y);
            output[lin_pos(new_x as usize, new_y as usize)] = '*';
        }
    }    
    println!("MAX x: {}, y: {}", max_x, max_y);
}
fn fill_output_buffer_from_point_list ( output : & mut Vec < char > , point_list : & Vec < ( f32 , f32 ) > ) { let mut max_x : i32 = - 1 ; let mut max_y : i32 = - 1 ; for ( x , y ) in point_list { println ! ( " " x y ) ; if ( * x >= - 1.0 && * x <= 1.0 ) && ( * y >= - 1.0 && * y <= 1.0 ) { let new_x = ( ( ( x + 1.0 ) / 2.0 ) * ( SCREEN_WIDTH - 1.0 ) ) as i32 ; let new_y = ( ( ( y + 1.0 ) / 2.0 ) * ( SCREEN_HEIGHT - 1.0 ) ) as i32 ; if new_x > max_x { max_x = new_x ; } if new_y > max_y { max_y = new_y ; } println ! ( " " new_x new_y ) ; output [ lin_pos ( new_x as usize , new_y as usize ) ] = '*' ; } } println ! ( " " max_x max_y ) ; }
Fill the output Vec with the Rust 2D PNG
Fill the output Vec with the Rust 2D PNG
output
& mut Vec<char>
point_list
& Vec<(f32, f32)>