From acdc430e0fbaa5647e7fa24c83be06ba8f6c39b4 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Sat, 15 Aug 2020 21:09:37 -0700 Subject: [PATCH] Fix determinate for 3x3 --- include/detail/matrix.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/detail/matrix.hpp b/include/detail/matrix.hpp index 910b304..419aa29 100644 --- a/include/detail/matrix.hpp +++ b/include/detail/matrix.hpp @@ -105,9 +105,9 @@ namespace math::detail{ template struct determinate_helper { static constexpr T perform(const matrix& m){ - return (m.get(0) * (m.get(4) * m.get(8)) - (m.get(5) - m.get(7)) - - m.get(1) * (m.get(3) * m.get(8)) - (m.get(5) * m.get(6)) + - m.get(2) * (m.get(3) * m.get(7)) - (m.get(4) * m.get(6))); + return (m.get(0) * ((m.get(4) * m.get(8)) - (m.get(5) * m.get(7))) - + m.get(1) * ((m.get(3) * m.get(8)) - (m.get(5) * m.get(6))) + + m.get(2) * ((m.get(3) * m.get(7)) - (m.get(4) * m.get(6)))); } }; template