+
+ pub fn cross_product(&self, p: Self) -> f64 {
+ return self.x * p.y - self.y * p.x;
+ }
+
+ /// Returns the perpendicular projection of this vector on a line with the specified angle.
+ pub fn project_onto(&self, angle: Angle) -> Point<f64> {
+ let dot_product = self.length() * (self.to_angle() - angle).to_radians().cos();
+ Point::from(angle) * dot_product
+ }