more generic point in result_point_util

This commit is contained in:
Henry Schimke
2023-05-04 14:15:14 -05:00
parent 326da6808a
commit b508698334
2 changed files with 8 additions and 8 deletions

View File

@@ -365,6 +365,13 @@ where
y: self.y.floor(),
}
}
/**
* Returns the z component of the cross product between vectors BC and BA.
*/
pub fn crossProductZ(a: PointT<T>, b: PointT<T>, c: PointT<T>) -> T {
((c.x - b.x) * (a.y - b.y)) - ((c.y - b.y) * (a.x - b.x))
}
}
impl From<(i32, i32)> for Point {