diff --git a/src/Math/Test/VectorTest.cpp b/src/Math/Test/VectorTest.cpp index 7a3ef084b..5a93d3924 100644 --- a/src/Math/Test/VectorTest.cpp +++ b/src/Math/Test/VectorTest.cpp @@ -110,7 +110,7 @@ void VectorTest::angle() { Error::setOutput(&o); /* Both vectors must be normalized, otherwise NaN is returned */ CORRADE_COMPARE(Vector3::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), {1.0f, -2.0f, 3.0f}), numeric_limits::quiet_NaN()); - CORRADE_COMPARE(o.str(), "Math::Vector::angle(): vectors must be normalized!\n"); + CORRADE_COMPARE(o.str(), "Math::Vector::angle(): vectors must be normalized\n"); CORRADE_COMPARE(Vector3::angle({2.0f, 3.0f, 4.0f}, Vector3(1.0f, -2.0f, 3.0f).normalized()), numeric_limits::quiet_NaN()); CORRADE_COMPARE(Vector3::angle(Vector3(2.0f, 3.0f, 4.0f).normalized(), Vector3(1.0f, -2.0f, 3.0f).normalized()), rad(1.162514f)); diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 9d78a10ca..b3ec031a2 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -85,12 +85,12 @@ template class Vector: public RectangularMatrix<1, s, T> { * @f[ * \phi = \frac{a \cdot b}{|a| \cdot |b|} * @f] - * @attention If any of the parameters is not normalized (and - * assertions are enabled), returns NaN. + * @attention Assertion fails on non-normalized vectors and NaN is + * returned. */ inline static T angle(const Vector& a, const Vector& b) { CORRADE_ASSERT(MathTypeTraits::equals(a.dot(), T(1)) && MathTypeTraits::equals(b.dot(), T(1)), - "Math::Vector::angle(): vectors must be normalized!", std::numeric_limits::quiet_NaN()); + "Math::Vector::angle(): vectors must be normalized", std::numeric_limits::quiet_NaN()); return std::acos(dot(a, b)); }