diff --git a/src/Magnum.h b/src/Magnum.h index 2fb91a908..653f66994 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -51,8 +51,6 @@ namespace Magnum { /** @todoc Remove `ifndef` when Doxygen is sane again */ #ifndef DOXYGEN_GENERATING_OUTPUT namespace Math { - template constexpr T deg(T value); - template constexpr T rad(T value); template struct Constants; constexpr Rad operator "" _rad(long double); @@ -125,10 +123,6 @@ typedef Math::Geometry::Rectangle Rectangle; /** @brief Integer rectangle */ typedef Math::Geometry::Rectangle Rectanglei; -/* Copying angle converters from Math namespace */ -using Math::deg; -using Math::rad; - /* Using angle literals from Math namespace */ using Math::operator "" _deg; using Math::operator "" _degf; diff --git a/src/Math/Constants.h b/src/Math/Constants.h index d3c2a88cc..7f4e3aa6b 100644 --- a/src/Math/Constants.h +++ b/src/Math/Constants.h @@ -16,7 +16,7 @@ */ /** @file - * @brief Class Magnum::Math::Constants, functions Magnum::Math::deg(), Magnum::Math::rad() + * @brief Class Magnum::Math::Constants */ namespace Magnum { namespace Math { @@ -34,7 +34,7 @@ template struct Constants { /** * @brief Pi * - * @see deg(), rad() + * @see Deg, Rad */ static inline constexpr T pi(); @@ -60,29 +60,6 @@ template<> struct Constants { }; #endif -/** -@brief Angle in degrees - -Function to make angle entering less error-prone. Converts the value to -radians at compile time. For example `deg(180.0f)` is converted to `3.14f`. - -Usable for entering e.g. rotation: -@code -Matrix4::rotation(deg(30.0f), Vector3::yAxis()); -@endcode - -@see Magnum::deg(), Constants, rad() -*/ -template inline constexpr T deg(T value) { return value*Constants::pi()/180; } - -/** -@brief Angle in radians - -See deg() for more information. -@see Magnum::rad() -*/ -template inline constexpr T rad(T value) { return value; } - }} #endif diff --git a/src/Math/Test/ConstantsTest.cpp b/src/Math/Test/ConstantsTest.cpp index 1bfe32b72..1354beacf 100644 --- a/src/Math/Test/ConstantsTest.cpp +++ b/src/Math/Test/ConstantsTest.cpp @@ -25,12 +25,10 @@ class ConstantsTest: public Corrade::TestSuite::Tester { ConstantsTest(); void constants(); - void degrad(); }; ConstantsTest::ConstantsTest() { - addTests(&ConstantsTest::constants, - &ConstantsTest::degrad); + addTests(&ConstantsTest::constants); } void ConstantsTest::constants() { @@ -41,12 +39,6 @@ void ConstantsTest::constants() { CORRADE_COMPARE(Math::pow<2>(Constants::sqrt3()), 3.0); } -void ConstantsTest::degrad() { - CORRADE_COMPARE(deg(90.0), Constants::pi()/2); - CORRADE_COMPARE(deg(90.0f), Constants::pi()/2); - CORRADE_COMPARE(rad(Constants::pi()/2), Constants::pi()/2); -} - }}} CORRADE_TEST_MAIN(Magnum::Math::Test::ConstantsTest)