Implement Sub between two Points

This commit is contained in:
Hanno Braun 2025-01-09 18:33:34 +01:00
parent a2cc0f7699
commit 878f6051bc

View File

@ -30,3 +30,15 @@ where
Self { coords } Self { coords }
} }
} }
impl<P, const D: usize> ops::Sub<P> for Point<D>
where
P: Into<Point<D>>,
{
type Output = Vector<D>;
fn sub(self, other: P) -> Self::Output {
let other = other.into();
self.coords - other.coords
}
}