Implement std::ops::Sub<Point> for Point
This commit is contained in:
parent
dc97d6f33e
commit
6c2e28d20e
1 changed files with 8 additions and 0 deletions
|
|
@ -67,3 +67,11 @@ impl std::ops::Sub<Vector> for Point {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Sub<Point> for Point {
|
||||
type Output = Vector;
|
||||
|
||||
fn sub(self, point: Point) -> Vector {
|
||||
Vector::new(self.x - point.x, self.y - point.y)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue