pub fn new(view_area_size: Vec2d, a: Point, b: Point) -> ViewAreaTransformer {
        let window_width = view_area_size[0];
        let window_height = view_area_size[1];
        let cart_width = (a.x - b.x).abs();
        let cart_height = (a.y - b.y).abs();

        let scale = Self::compute_scale(window_width, window_height, cart_width, cart_height);
        let (offset_factor_x, offset_factor_y) = Self::compute_offset_factors(
            window_width,
            window_height,
            cart_width,
            cart_height,
            scale,
        );

        ViewAreaTransformer {
            // view_area_size: view_area_size,
            top_left: Point {
                x: a.x.min(b.x),
                y: a.y.max(b.y),
            },
            // bot_right: Point {
            //     x: a.x.max(b.x),
            //     y: a.y.min(b.y),
            // },
            scale,
            offset_factor_x,
            offset_factor_y,
        }
    }
/// Initializes a ViewAreaTranformer using the size of the view area, and two points that
/// define a rectangle in the cartesian plane that should be visible in the view area.
Initializes a ViewAreaTranformer using the size of the view area, and two points that
define a rectangle in the cartesian plane that should be visible in the view area.
Initializes a ViewAreaTranformer using the size of the view area and two points that define a rectangle in the cartesian plane that should be visible in the view area .
pub fn new(view_area_size: Vec2d, a: Point, b: Point) -> ViewAreaTransformer {
        let window_width = view_area_size[0];
        let window_height = view_area_size[1];
        let cart_width = (a.x - b.x).abs();
        let cart_height = (a.y - b.y).abs();
        let scale = Self::compute_scale(window_width, window_height, cart_width, cart_height);
        let (offset_factor_x, offset_factor_y) = Self::compute_offset_factors(
            window_width,
            window_height,
            cart_width,
            cart_height,
            scale,
        );
        ViewAreaTransformer {
            // view_area_size: view_area_size,
            top_left: Point {
                x: a.x.min(b.x),
                y: a.y.max(b.y),
            },
            // bot_right: Point {
            //     x: a.x.max(b.x),
            //     y: a.y.min(b.y),
            // },
            scale,
            offset_factor_x,
            offset_factor_y,
        }
    }
pub fn new ( view_area_size : Vec2d , a : Point , b : Point ) -> ViewAreaTransformer { let window_width = view_area_size [ 0 ] ; let window_height = view_area_size [ 1 ] ; let cart_width = ( a . x - b . x ) . abs ( ) ; let cart_height = ( a . y - b . y ) . abs ( ) ; let scale = Self :: compute_scale ( window_width , window_height , cart_width , cart_height ) ; let ( offset_factor_x , offset_factor_y ) = Self :: compute_offset_factors ( window_width , window_height , cart_width , cart_height , scale , ) ; ViewAreaTransformer { // view_area_size: view_area_size, top_left : Point { x : a . x . min ( b . x ) , y : a . y . max ( b . y ) , } , // bot_right: Point { //     x: a.x.max(b.x), //     y: a.y.min(b.y), // }, scale , offset_factor_x , offset_factor_y , } }
Initializes a ViewAreaTranformer using the size of the view area, and two points that
define a rectangle in the cartesian plane that should be visible in the view area.
Initializes a ViewAreaTranformer using the size of the view area and two points that define a rectangle in the cartesian plane that should be visible in the view area .
view_area_size
Vec2d
a
Point
b
Point