Browse Source

Math: simplify angle() implementation for Complex.

Not sure why that wasn't done before.
pull/267/head
Vladimír Vondruš 8 years ago
parent
commit
0f4b88870a
  1. 2
      src/Magnum/Math/Complex.h

2
src/Magnum/Math/Complex.h

@ -72,7 +72,7 @@ Expects that both complex numbers are normalized. @f[
template<class T> inline Rad<T> angle(const Complex<T>& normalizedA, const Complex<T>& normalizedB) {
CORRADE_ASSERT(normalizedA.isNormalized() && normalizedB.isNormalized(),
"Math::angle(): complex numbers must be normalized", {});
return Rad<T>(std::acos(normalizedA.real()*normalizedB.real() + normalizedA.imaginary()*normalizedB.imaginary()));
return Rad<T>(std::acos(dot(normalizedA, normalizedB)));
}
/**

Loading…
Cancel
Save