From 33816fab944015fdff14e7d6e1a8f17affee35db Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 7 Nov 2024 12:31:02 +1000 Subject: [PATCH] vector: use xy members instead of 01 indices for cross It's functionally identically, but is easier to read when comparing with maths documents. --- cruft/util/vector.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cruft/util/vector.hpp b/cruft/util/vector.hpp index 05181fc3..4457f11b 100644 --- a/cruft/util/vector.hpp +++ b/cruft/util/vector.hpp @@ -66,7 +66,7 @@ namespace cruft { T cross (vector<2,T> a, vector<2,T> b) { - return a[0] * b[1] - a[1] * b[0]; + return a.x * b.y - a.y * b.x; }