From 7b8506d102c3be20abdfea80de69470c8e8c0615 Mon Sep 17 00:00:00 2001 From: karl Date: Tue, 12 Jan 2021 18:44:21 +0100 Subject: [PATCH] Fix typo in cross product calculation --- geometry.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geometry.h b/geometry.h index 980fb30..506298f 100644 --- a/geometry.h +++ b/geometry.h @@ -1,3 +1,5 @@ +#pragma once + #include // Forward declarations @@ -24,7 +26,7 @@ struct Vector { } Vector cross(const Vector &other) { - return Vector(c[1] * other[2] - c[2] - other[1], c[2] * other[0] - c[0] * other[2], + return Vector(c[1] * other[2] - c[2] * other[1], c[2] * other[0] - c[0] * other[2], c[0] * other[1] - c[1] * other[0]); }