Common Mathematical Functions For Fixed Types. More...
Namespaces | |
playrho::detail | |
Name space for internal/detail related PlayRho names. | |
Functions | |
template<typename BT , unsigned int FB, int N = 5> | |
constexpr Fixed< BT, FB > | playrho::abs (Fixed< BT, FB > arg) |
Computes the absolute value. More... | |
template<typename BT , unsigned int FB> | |
constexpr Fixed< BT, FB > | playrho::pow (Fixed< BT, FB > value, int n) |
Computes the value of the given number raised to the given power. More... | |
template<typename BT , unsigned int FB> | |
constexpr Fixed< BT, FB > | playrho::trunc (Fixed< BT, FB > arg) |
Truncates the given value. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::nextafter (Fixed< BT, FB > from, Fixed< BT, FB > to) noexcept |
Next after function for Fixed types. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::fmod (Fixed< BT, FB > dividend, Fixed< BT, FB > divisor) noexcept |
Computes the remainder of the division of the given dividend by the given divisor. More... | |
template<typename BT , unsigned int FB> | |
auto | playrho::sqrt (Fixed< BT, FB > arg) |
Square root's the given value. More... | |
template<typename BT , unsigned int FB> | |
bool | playrho::isnormal (Fixed< BT, FB > arg) |
Gets whether the given value is normal - i.e. not 0 nor infinite. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::sin (Fixed< BT, FB > arg) |
Computes the sine of the argument for Fixed types. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::cos (Fixed< BT, FB > arg) |
Computes the cosine of the argument for Fixed types. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::atan (Fixed< BT, FB > arg) |
Computes the arc tangent. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::atan2 (Fixed< BT, FB > y, Fixed< BT, FB > x) |
Computes the multi-valued inverse tangent. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::log (Fixed< BT, FB > arg) |
Computes the natural logarithm of the given argument. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::exp (Fixed< BT, FB > arg) |
Computes the Euler number raised to the power of the given argument. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::pow (Fixed< BT, FB > base, Fixed< BT, FB > exponent) |
Computes the value of the base number raised to the power of the exponent. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::hypot (Fixed< BT, FB > x, Fixed< BT, FB > y) |
Computes the square root of the sum of the squares. More... | |
template<typename BT , unsigned int FB> | |
Fixed< BT, FB > | playrho::round (Fixed< BT, FB > value) noexcept |
Rounds the given value. More... | |
template<typename BT , unsigned int FB> | |
bool | playrho::signbit (Fixed< BT, FB > value) noexcept |
Determines whether the given value is negative. More... | |
template<typename BT , unsigned int FB> | |
constexpr bool | playrho::isnan (Fixed< BT, FB > value) noexcept |
Gets whether the given value is not-a-number. More... | |
template<typename BT , unsigned int FB> | |
bool | playrho::isfinite (Fixed< BT, FB > value) noexcept |
Gets whether the given value is finite. More... | |
Common Mathematical Functions For Fixed Types.
|
constexpr |
Computes the absolute value.
Referenced by playrho::abs(), playrho::d2::UnitVec::Absolute(), playrho::AlmostEqual(), playrho::AlmostZero(), playrho::detail::atan(), playrho::d2::Cap(), playrho::GetAreaOfPolygon(), playrho::d2::GetToiViaSat(), playrho::d2::InitVelocity(), playrho::d2::RayCast(), playrho::d2::SolvePosition(), and playrho::d2::WorldImpl::Update().
|
inline |
Computes the multi-valued inverse tangent.
-Pi
and +Pi
inclusive. Referenced by playrho::Atan2().
Computes the cosine of the argument for Fixed types.
Referenced by playrho::d2::UnitVec::Get(), playrho::GetCircleVertices(), and playrho::d2::RotateAboutWorldPoint().
Computes the Euler number raised to the power of the given argument.
Referenced by playrho::pow().
|
inlinenoexcept |
Computes the remainder of the division of the given dividend by the given divisor.
Referenced by playrho::detail::AngularNormalize(), and playrho::ModuloViaFmod().
|
inline |
Computes the square root of the sum of the squares.
Referenced by playrho::d2::UnitVec::Get().
|
inlinenoexcept |
Gets whether the given value is finite.
Referenced by playrho::Cross(), and playrho::d2::GetToiViaSat().
|
constexprnoexcept |
Gets whether the given value is not-a-number.
|
inline |
Gets whether the given value is normal - i.e. not 0 nor infinite.
Referenced by playrho::d2::UnitVec::Get().
Computes the natural logarithm of the given argument.
Referenced by playrho::pow().
|
inlinenoexcept |
Next after function for Fixed types.
Referenced by playrho::d2::WorldImpl::GetSoonestContact(), playrho::d2::GetToiViaSat(), playrho::IsMaxTranslationWithinTolerance(), and playrho::d2::RayCast().
|
inline |
Computes the value of the base number raised to the power of the exponent.
|
constexpr |
Computes the value of the given number raised to the given power.
Referenced by playrho::pow().
|
inlinenoexcept |
Rounds the given value.
Referenced by playrho::RoundOff().
|
inlinenoexcept |
Determines whether the given value is negative.
Referenced by playrho::d2::ClipSegmentToLine(), and playrho::d2::Body::SetAcceleration().
Computes the sine of the argument for Fixed types.
Referenced by playrho::d2::UnitVec::Get(), playrho::GetCircleVertices(), and playrho::d2::RotateAboutWorldPoint().
|
inline |
Square root's the given value.
std::sqrt
to be exact to within half of a ULP for floating-point types (float, double). That sets a precedence that puts a high expectation on this implementation for fixed-point types. arg
is less than zero. NaN
value. Referenced by playrho::d2::Cap(), playrho::d2::UnitVec::Get(), playrho::d2::VertexSet::GetDefaultMinSeparationSquared(), playrho::GetMagnitude(), playrho::hypot(), playrho::MixFriction(), and playrho::d2::RayCast().
|
constexpr |
Truncates the given value.
Referenced by playrho::fmod(), and playrho::ModuloViaTrunc().