Implement Neg for Vector

This commit is contained in:
Hanno Braun 2025-01-20 19:21:18 +01:00
parent 60864e75a5
commit 337957caf6

View File

@ -106,6 +106,14 @@ where
}
}
impl<const D: usize> ops::Neg for Vector<D> {
type Output = Self;
fn neg(self) -> Self::Output {
self * -1.
}
}
impl<V, const D: usize> ops::Sub<V> for Vector<D>
where
V: Into<Vector<D>>,