From 699287623d51be688f2af0a01fedcf90d035da13 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 20 Apr 2022 22:04:37 +0800 Subject: Bugfix: vec3::cross was implemented and tested incorrectly. --- vec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vec.h') 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. -- cgit v1.2.3