diff -r 6a3bcb7c2981 -r 36b792842d5b rust/integral-geometry/src/lib.rs --- a/rust/integral-geometry/src/lib.rs Sat Nov 03 02:31:21 2018 +0300 +++ b/rust/integral-geometry/src/lib.rs Sat Nov 03 02:48:24 2018 +0300 @@ -63,6 +63,11 @@ pub fn rotate90(self) -> Self { Point::new(self.y, -self.x) } + + #[inline] + pub fn cross(self, other: Point) -> i32 { + self.dot(other.rotate90()) + } } #[derive(PartialEq, Eq, Clone, Copy, Debug)]