Expand auto-format coverage and tiny style changes

This commit is contained in:
kamilritz
2020-01-23 14:41:58 +01:00
committed by Mathieu Bresciani
parent fbdd75da2e
commit f20726d47f
12 changed files with 178 additions and 228 deletions
+7 -23
View File
@@ -42,34 +42,18 @@
#ifdef ECL_STANDALONE
namespace math
{
namespace math {
float min(float val1, float val2)
{
return (val1 < val2) ? val1 : val2;
}
float min(float val1, float val2) { return (val1 < val2) ? val1 : val2; }
float max(float val1, float val2)
{
return (val1 > val2) ? val1 : val2;
}
float max(float val1, float val2) { return (val1 > val2) ? val1 : val2; }
float constrain(float val, float min, float max)
{
return (val < min) ? min : ((val > max) ? max : val);
}
float constrain(float val, float min, float max) { return (val < min) ? min : ((val > max) ? max : val); }
float radians(float degrees)
{
return (degrees / 180.0f) * M_PI_F;
}
float radians(float degrees) { return (degrees / 180.0f) * M_PI_F; }
float degrees(float radians)
{
return (radians * 180.0f) / M_PI_F;
}
float degrees(float radians) { return (radians * 180.0f) / M_PI_F; }
} // namespace math
} // namespace math
#endif /* ECL_STANDALONE */
+4 -5
View File
@@ -51,8 +51,7 @@
#define M_PI_2_F (M_PI / 2.0f)
#endif
namespace math
{
namespace math {
// using namespace Eigen;
float min(float val1, float val2);
@@ -61,10 +60,10 @@ float constrain(float val, float min, float max);
float radians(float degrees);
float degrees(float radians);
}
} // namespace math
#else
#include <mathlib/mathlib.h>
#endif //ECL_STANDALONE
#endif //MATHLIB_H
#endif // ECL_STANDALONE
#endif // MATHLIB_H