Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
Loading...
Searching...
No Matches
Namespaces | Functions
QuantityFuncs.hpp File Reference
#include <algorithm>
#include <cmath>
#include "Phyth/Core/Quantity.hpp"
#include "Phyth/Core/Quantities.hpp"
Include dependency graph for QuantityFuncs.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Phyth
 
namespace  Phyth::Utils
 

Functions

Scalar Phyth::Utils::sin (const Scalar q)
 Sine of a dimensionless quantity.
 
Scalar Phyth::Utils::cos (const Scalar q)
 Cosine of a dimensionless quantity.
 
Scalar Phyth::Utils::tan (const Scalar q)
 Tangent of a dimensionless quantity.
 
Scalar Phyth::Utils::asin (const Scalar q)
 Arc sine (inverse sine)
 
Scalar Phyth::Utils::acos (const Scalar q)
 Arc cosine (inverse cosine)
 
Scalar Phyth::Utils::atan (const Scalar q)
 Arc tangent (inverse tangent)
 
Scalar Phyth::Utils::atan2 (const Scalar y, const Scalar x)
 Two-argument arc tangent (atan2)
 
Scalar Phyth::Utils::sinh (const Scalar q)
 Hyperbolic sine.
 
Scalar Phyth::Utils::cosh (const Scalar q)
 Hyperbolic cosine.
 
Scalar Phyth::Utils::tanh (const Scalar q)
 Hyperbolic tangent.
 
Scalar Phyth::Utils::asinh (const Scalar q)
 Inverse hyperbolic sine.
 
Scalar Phyth::Utils::acosh (const Scalar q)
 Inverse hyperbolic cosine.
 
Scalar Phyth::Utils::atanh (const Scalar q)
 Inverse hyperbolic tangent.
 
Scalar Phyth::Utils::log (const Scalar q)
 Natural logarithm (base e)
 
Scalar Phyth::Utils::log10 (const Scalar q)
 Base-10 logarithm.
 
Scalar Phyth::Utils::log2 (const Scalar q)
 Base-2 logarithm.
 
Scalar Phyth::Utils::log1p (const Scalar q)
 log(1 + q) with higher precision for small q
 
Scalar Phyth::Utils::exp (const Scalar q)
 Exponential (e^q)
 
Scalar Phyth::Utils::expm1 (const Scalar q)
 exp(q) - 1 with higher precision for small q
 
Scalar Phyth::Utils::exp2 (const Scalar q)
 Base-2 exponential (2^q)
 
template<int Power, typename UnitT >
auto Phyth::Utils::pow (Quantity< UnitT > q)
 Raise a quantity to an integer power.
 
template<typename UnitT >
auto Phyth::Utils::square (Quantity< UnitT > q)
 Square of a quantity.
 
template<typename UnitT >
auto Phyth::Utils::cube (Quantity< UnitT > q)
 Cube of a quantity.
 
template<int N, typename UnitT >
auto Phyth::Utils::root (Quantity< UnitT > q)
 N-th root of a quantity.
 
template<typename UnitT >
auto Phyth::Utils::sqrt (Quantity< UnitT > q)
 Square root of a quantity.
 
template<typename UnitT >
auto Phyth::Utils::cbrt (Quantity< UnitT > q)
 Cube root of a quantity.
 
template<typename UnitT >
auto Phyth::Utils::abs (Quantity< UnitT > q)
 Absolute value of a quantity.
 
template<typename UnitT >
Quantity< UnitT > Phyth::Utils::fmod (Quantity< UnitT > x, Quantity< UnitT > y)
 Floating-point remainder of x / y.
 
template<typename UnitT >
Quantity< UnitT > Phyth::Utils::modf (Quantity< UnitT > x, Quantity< UnitT > &y)
 Decompose into integer and fractional parts.
 
template<typename UnitT >
Quantity< UnitT > Phyth::Utils::max (Quantity< UnitT > x, Quantity< UnitT > y)
 Maximum of two quantities.
 
template<typename UnitT >
Quantity< UnitT > Phyth::Utils::min (Quantity< UnitT > x, Quantity< UnitT > y)
 Minimum of two quantities.
 
template<typename UnitT >
Quantity< UnitT > Phyth::Utils::clamp (Quantity< UnitT > x, Quantity< UnitT > min, Quantity< UnitT > max)
 Clamp a quantity between min and max bounds.
 
template<typename UnitT >
Quantity< UnitT > Phyth::Utils::floor (Quantity< UnitT > x)
 Floor of a quantity (largest integer <= x)
 
template<typename UnitT >
bool Phyth::Utils::isnan (Quantity< UnitT > x)
 Determine whether a quantity is nan.
 
template<typename UnitT >
bool Phyth::Utils::isfinite (Quantity< UnitT > x)
 Determine whether a quantity is finite.