wipe/src/vec.rs

15 lines
269 B
Rust
Raw Normal View History

2022-04-02 15:23:19 +00:00
#[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)
}
}