From 0f4b88870a1f14eb25d9933e376a5f0ce5dd477c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 30 Aug 2018 23:01:17 +0200 Subject: [PATCH] Math: simplify angle() implementation for Complex. Not sure why that wasn't done before. --- src/Magnum/Math/Complex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index f966aa2ef..cc9cb73b7 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -72,7 +72,7 @@ Expects that both complex numbers are normalized. @f[ template inline Rad angle(const Complex& normalizedA, const Complex& normalizedB) { CORRADE_ASSERT(normalizedA.isNormalized() && normalizedB.isNormalized(), "Math::angle(): complex numbers must be normalized", {}); - return Rad(std::acos(normalizedA.real()*normalizedB.real() + normalizedA.imaginary()*normalizedB.imaginary())); + return Rad(std::acos(dot(normalizedA, normalizedB))); } /**