vector: use xy members instead of 01 indices for cross

It's functionally identically, but is easier to read when comparing with
maths documents.
This commit is contained in:
Danny Robson 2024-11-07 12:31:02 +10:00
parent c243261dda
commit 33816fab94

View File

@ -66,7 +66,7 @@ namespace cruft {
T T
cross (vector<2,T> a, vector<2,T> b) 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;
} }