rust/integral-geometry/src/lib.rs
changeset 14108 36b792842d5b
parent 14107 6a3bcb7c2981
child 14112 f04bc39f0c05
--- 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)]