From d51e2e521b1a23c1d8ed8a75106b835aa1e7653c Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 10 Aug 2013 20:57:04 +0200 Subject: [PATCH] added a 2x2 vector determinant for convenience --- include/mitsuba/core/vector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/mitsuba/core/vector.h b/include/mitsuba/core/vector.h index 54364615..2b59c012 100644 --- a/include/mitsuba/core/vector.h +++ b/include/mitsuba/core/vector.h @@ -405,6 +405,10 @@ template inline T absDot(const TVector2 &v1, const TVector2 & return std::abs(dot(v1, v2)); } +template inline T det(const TVector2 &v1, const TVector2 &v2) { + return v1.x * v2.y - v1.y * v2.x; +} + template inline TVector2 normalize(const TVector2 &v) { return v / v.length(); }