mirror of
https://github.com/ricoriedel/wipe.git
synced 2024-11-05 07:36:41 +00:00
15 lines
269 B
Rust
15 lines
269 B
Rust
|
#[derive(Copy, Clone)]
|
||
|
pub struct Vector {
|
||
|
pub x: f32,
|
||
|
pub y: f32
|
||
|
}
|
||
|
|
||
|
impl Vector {
|
||
|
pub fn new(x: f32, y: f32) -> Self {
|
||
|
Self { x, y }
|
||
|
}
|
||
|
|
||
|
pub fn from_terminal(x: usize, y: usize) -> Self {
|
||
|
Vector::new(x as f32, y as f32 * 2.0)
|
||
|
}
|
||
|
}
|