Go to the documentation of this file.
25 #include "spdlog/fmt/ostr.h"
26 #include "spdlog/spdlog.h"
39 #define AD_PHYSICS_ANGULARVELOCITY_THROWS_EXCEPTION 1
41 #if SAFE_DATATYPES_EXPLICIT_CONVERSION
45 #define _AD_PHYSICS_ANGULARVELOCITY_EXPLICIT_CONVERSION_ explicit
50 #define _AD_PHYSICS_ANGULARVELOCITY_EXPLICIT_CONVERSION_
85 : mAngularVelocity(std::numeric_limits<double>::quiet_NaN())
95 : mAngularVelocity(iAngularVelocity)
138 return std::fabs(mAngularVelocity - other.mAngularVelocity) <
cPrecisionValue;
166 return (mAngularVelocity > other.mAngularVelocity) &&
operator!=(other);
182 return (mAngularVelocity < other.mAngularVelocity) &&
operator!=(other);
198 return ((mAngularVelocity > other.mAngularVelocity) ||
operator==(other));
214 return ((mAngularVelocity < other.mAngularVelocity) ||
operator==(other));
231 AngularVelocity const result(mAngularVelocity + other.mAngularVelocity);
250 mAngularVelocity += other.mAngularVelocity;
269 AngularVelocity const result(mAngularVelocity - other.mAngularVelocity);
288 mAngularVelocity -= other.mAngularVelocity;
344 double const result = mAngularVelocity / other.mAngularVelocity;
372 return mAngularVelocity;
384 auto const valueClass = std::fpclassify(mAngularVelocity);
385 return ((valueClass == FP_NORMAL) || (valueClass == FP_ZERO)) && (
cMinValue <= mAngularVelocity)
399 spdlog::info(
"ensureValid(::ad::physics::AngularVelocity)>> {} value out of range", *
this);
400 #if (AD_PHYSICS_ANGULARVELOCITY_THROWS_EXCEPTION == 1)
401 throw std::out_of_range(
"AngularVelocity value out of range");
417 spdlog::info(
"ensureValid(::ad::physics::AngularVelocity)>> {} value is zero", *
this);
418 #if (AD_PHYSICS_ANGULARVELOCITY_THROWS_EXCEPTION == 1)
419 throw std::out_of_range(
"AngularVelocity value is zero");
452 double mAngularVelocity;
470 return value.operator*(other);
481 inline ::ad::physics::AngularVelocity
fabs(const ::ad::physics::AngularVelocity other)
501 static inline ::ad::physics::AngularVelocity
lowest()
503 return ::ad::physics::AngularVelocity::getMin();
508 static inline ::ad::physics::AngularVelocity
max()
510 return ::ad::physics::AngularVelocity::getMax();
516 static inline ::ad::physics::AngularVelocity
epsilon()
518 return ::ad::physics::AngularVelocity::getPrecision();
527 #ifndef GEN_GUARD_AD_PHYSICS_ANGULARVELOCITY
528 #define GEN_GUARD_AD_PHYSICS_ANGULARVELOCITY
549 return os << double(_value);
561 return to_string(
static_cast<double>(value));
564 #endif // GEN_GUARD_AD_PHYSICS_ANGULARVELOCITY
bool isValid() const
Definition: AngularVelocity.hpp:382
namespace ad
Definition: Acceleration.hpp:30
double operator/(const AngularVelocity &other) const
standard arithmetic operator
Definition: AngularVelocity.hpp:340
void ensureValid() const
ensure that the AngularVelocity is valid
Definition: AngularVelocity.hpp:395
bool operator>=(const AngularVelocity &other) const
standard comparison operator
Definition: AngularVelocity.hpp:194
static inline ::ad::physics::AngularVelocity max()
Definition: AngularVelocity.hpp:508
void ensureValidNonZero() const
ensure that the AngularVelocity is valid and non zero
Definition: AngularVelocity.hpp:412
static const double cMaxValue
constant defining the maximum valid AngularVelocity value (used in isValid())
Definition: AngularVelocity.hpp:70
AngularVelocity operator*(const double &scalar) const
standard arithmetic operator
Definition: AngularVelocity.hpp:303
inline ::ad::physics::AngularVelocity operator*(const double &other, ::ad::physics::AngularVelocity const &value)
standard arithmetic operator
Definition: AngularVelocity.hpp:468
static inline ::ad::physics::AngularVelocity lowest()
Definition: AngularVelocity.hpp:501
static inline ::ad::physics::AngularVelocity epsilon()
Definition: AngularVelocity.hpp:516
bool operator<(const AngularVelocity &other) const
standard comparison operator
Definition: AngularVelocity.hpp:178
_AD_PHYSICS_ANGULARVELOCITY_EXPLICIT_CONVERSION_ AngularVelocity(double const iAngularVelocity)
standard constructor
Definition: AngularVelocity.hpp:94
static AngularVelocity getMax()
get maximum valid AngularVelocity (i.e. cMaxValue)
Definition: AngularVelocity.hpp:435
AngularVelocity operator+(const AngularVelocity &other) const
standard arithmetic operator
Definition: AngularVelocity.hpp:227
AngularVelocity operator-(const AngularVelocity &other) const
standard arithmetic operator
Definition: AngularVelocity.hpp:265
bool operator>(const AngularVelocity &other) const
standard comparison operator
Definition: AngularVelocity.hpp:162
bool operator<=(const AngularVelocity &other) const
standard comparison operator
Definition: AngularVelocity.hpp:210
AngularVelocity & operator=(const AngularVelocity &other)=default
standard assignment operator
AngularVelocity operator/(const double &scalar) const
standard arithmetic operator
Definition: AngularVelocity.hpp:321
bool operator!=(const AngularVelocity &other) const
standard comparison operator
Definition: AngularVelocity.hpp:148
AngularVelocity operator-() const
standard arithmetic operator
Definition: AngularVelocity.hpp:356
inline ::ad::physics::Weight fabs(const ::ad::physics::Weight other)
overload of the std::fabs for Weight
Definition: Weight.hpp:480
inline ::ad::physics::Acceleration fabs(const ::ad::physics::Acceleration other)
overload of the std::fabs for Acceleration
Definition: Acceleration.hpp:481
bool operator==(const AngularVelocity &other) const
standard comparison operator
Definition: AngularVelocity.hpp:134
std::string to_string(::ad::physics::Acceleration const &value)
overload of the std::to_string for Acceleration
Definition: Acceleration.hpp:559
AngularVelocity operator-=(const AngularVelocity &other)
standard arithmetic operator
Definition: AngularVelocity.hpp:284
DataType AngularVelocity.
Definition: AngularVelocity.hpp:59
static AngularVelocity getPrecision()
get assumed accuracy of AngularVelocity (i.e. cPrecisionValue)
Definition: AngularVelocity.hpp:443
static AngularVelocity getMin()
get minimum valid AngularVelocity (i.e. cMinValue)
Definition: AngularVelocity.hpp:427
#define _AD_PHYSICS_ANGULARVELOCITY_EXPLICIT_CONVERSION_
Enable/Disable explicit conversion. Currently set to "implicit conversion allowed".
Definition: AngularVelocity.hpp:50
static const double cMinValue
constant defining the minimum valid AngularVelocity value (used in isValid())
Definition: AngularVelocity.hpp:65
AngularVelocity & operator+=(const AngularVelocity &other)
standard arithmetic operator
Definition: AngularVelocity.hpp:246
static const double cPrecisionValue
constant defining the assumed AngularVelocity value accuracy (used in comparison operator==(),...
Definition: AngularVelocity.hpp:76
std::ostream & operator<<(std::ostream &os, Acceleration const &_value)
standard ostream operator
Definition: Acceleration.hpp:547
AngularVelocity()
default constructor
Definition: AngularVelocity.hpp:84