mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 19:08:28 +00:00
Implement Sub
for Point
/Vector
This commit is contained in:
parent
8be6b041aa
commit
1b7adfd87f
@ -38,3 +38,12 @@ impl<const D: usize> ops::Sub<Point<D>> for Point<D> {
|
||||
self.coords - other.coords
|
||||
}
|
||||
}
|
||||
|
||||
impl<const D: usize> ops::Sub<Vector<D>> for Point<D> {
|
||||
type Output = Point<D>;
|
||||
|
||||
fn sub(self, other: Vector<D>) -> Self::Output {
|
||||
let coords = self.coords - other;
|
||||
Self { coords }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user