clang-format set BreakBeforeBraces to Linux style

- this keeps things consistent with PX4/Firmware astyle
This commit is contained in:
Daniel Agar
2020-06-25 13:23:52 -04:00
parent b96c62ed8b
commit 2927132954
6 changed files with 53 additions and 23 deletions
+12 -6
View File
@@ -55,29 +55,35 @@
#define M_PI 3.141592653589793238462643383280
#endif
namespace math {
namespace math
{
template <typename Type>
static constexpr Type min(Type val1, Type val2) {
static constexpr Type min(Type val1, Type val2)
{
return (val1 < val2) ? val1 : val2;
}
template <typename Type>
static constexpr Type max(Type val1, Type val2) {
static constexpr Type max(Type val1, Type val2)
{
return (val1 > val2) ? val1 : val2;
}
template <typename Type>
static constexpr Type constrain(Type val, Type min, Type max) {
static constexpr Type constrain(Type val, Type min, Type max)
{
return (val < min) ? min : ((val > max) ? max : val);
}
template <typename Type>
static constexpr Type radians(Type degrees) {
static constexpr Type radians(Type degrees)
{
return (degrees / Type(180)) * Type(M_PI);
}
template <typename Type>
static constexpr Type degrees(Type radians) {
static constexpr Type degrees(Type radians)
{
return (radians * Type(180)) / Type(M_PI);
}