graphics_rs/math/
vec2.rs

1pub struct Vec2<T: Sized + Copy> {
2    x: T,
3    y: T,
4}
5
6impl<T: Sized + Copy> Vec2<T> {
7    pub fn new(x: T, y: T) -> Self {
8        Self { x, y }
9    }
10
11    pub fn x(&self) -> T {
12        self.x
13    }
14
15    pub fn y(&self) -> T {
16        self.y
17    }
18}