From 4bd22e4d813172eee232d480dc8a00e85f6e4fcb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 1 May 2017 01:17:39 +0200 Subject: simple-mat: broke cross product formula --- compat/simple-mat.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compat') diff --git a/compat/simple-mat.hpp b/compat/simple-mat.hpp index 46d9e382..9490473a 100644 --- a/compat/simple-mat.hpp +++ b/compat/simple-mat.hpp @@ -134,14 +134,14 @@ public: template typename std::enable_if::value, Mat::P, is_dim3::Q>>::type - cross(const Mat& p2) const + cross(const Mat& b) const { static_assert(P == h_ && Q == w_, ""); - decltype(*this)& p1 = *this; + decltype(*this)& a = *this; - return Mat(p1.y() * p2.z() - p1.y() * p2.z(), - p1.x() * p2.z() - p1.x() * p2.z(), - p1.x() * p2.y() - p1.y() * p2.x()); + return Mat(a.y()*b.z() - a.z()*b.y(), + a.z()*b.x() - a.x()*b.z(), + a.x()*b.y() - a.y()*b.x()); } Mat operator+(const Mat& other) const -- cgit v1.2.3