]> git.localhorst.tv Git - space.git/blobdiff - src/graphics/Vector.h
added autopilot that sucks
[space.git] / src / graphics / Vector.h
index 992ba1eef6a8bbdc323b8f612eef14eb2471f7d7..4cf920bd70b8a6eaeafb8f9f75ab04ce1570ace7 100644 (file)
@@ -142,6 +142,10 @@ constexpr bool operator !=(Vector<Scalar> lhs, Vector<Scalar> rhs) {
 }
 
 
+template<class Scalar>
+constexpr Scalar Cross2D(Vector<Scalar> lhs, Vector<Scalar> rhs) {
+       return (lhs.x * rhs.y) - (lhs.y * rhs.x);
+}
 template<class Scalar>
 constexpr Scalar Dot(Vector<Scalar> lhs, Vector<Scalar> rhs) {
        return (lhs.x * rhs.x) + (lhs.y * rhs.y);