mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-26 09:06:33 +11:00
commit
3734d01709
1 changed files with 12 additions and 0 deletions
|
@ -720,6 +720,18 @@ impl<T: Number> Vector2D<T> {
|
||||||
pub fn get(self) -> (T, T) {
|
pub fn get(self) -> (T, T) {
|
||||||
(self.x, self.y)
|
(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]
|
#[test_case]
|
||||||
|
|
Loading…
Add table
Reference in a new issue