mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
add more maths
This commit is contained in:
parent
225689b13d
commit
2838ea5f32
|
@ -720,6 +720,18 @@ impl<T: Number> Vector2D<T> {
|
|||
pub fn get(self) -> (T, T) {
|
||||
(self.x, self.y)
|
||||
}
|
||||
pub fn hadamard(self, other: Self) -> Self {
|
||||
Self {
|
||||
x: self.x * other.x,
|
||||
y: self.y * other.y,
|
||||
}
|
||||
}
|
||||
pub fn swap(self) -> Self {
|
||||
Self {
|
||||
x: self.y,
|
||||
y: self.x,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test_case]
|
||||
|
|
Loading…
Reference in a new issue