summaryrefslogtreecommitdiff
path: root/vec.h
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-20 22:04:37 +0800
committerKeuin <[email protected]>2022-04-20 22:04:37 +0800
commit699287623d51be688f2af0a01fedcf90d035da13 (patch)
tree4c563ebfb810efb78acca0796b5b49d594e69c05 /vec.h
parentbfc5e815e6e157291ad653b9ea97bb12ca8bc835 (diff)
Bugfix: vec3::cross was implemented and tested incorrectly.
Diffstat (limited to 'vec.h')
-rw-r--r--vec.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/vec.h b/vec.h
index e3e15b8..84cbaa3 100644
--- a/vec.h
+++ b/vec.h
@@ -76,7 +76,7 @@ struct vec3 {
// cross product (aka outer product, or vector product, producing a vector)
vec3 cross(const vec3 &b) const {
- return vec3{.x=y * b.z - z * b.y, .y=x * b.z - z * b.x, .z=x * b.y - y * b.x};
+ return vec3{.x=y * b.z - z * b.y, .y=z * b.x - x * b.z, .z=x * b.y - y * b.x};
}
// Multiply with b on every dimension.