Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::math::utils Namespace Reference

Functions

template<typename T1 , typename T2 , typename T3 = double>
requires std::is_arithmetic_v<T1> && std::is_arithmetic_v<T2> && std::is_arithmetic_v<T3>
bool isEqual (T1 d1, T2 d2, T3 tolerance=iv::constants::maths::Precision)
 
template<typename T >
requires std::is_floating_point_v<T>
roundToDecimals (T value, uint8_t decimals)
 
bool isSameSign (const double value1, const double value2, const double precision)
 
double valueInterpolation (double valueNormalized, double valueMin, double valueMax)
 
int64_t mmToDp (int64_t sizeMm)
 
iv::types::radian degreeToRadian (iv::types::degree degree)
 
iv::types::degree radianToDegree (iv::types::radian radian)
 
iv::math::geometry::Point2d pointOnCircle (iv::types::radius radius, iv::types::degree angle)
 
double stepsIncrement (const iv::types::Range< double > range, const uint64_t steps)
 
double roundToNearestStep (double value, const double step, iv::types::Range< double > range)
 
template<typename T1 , typename T2 = double>
requires std::is_arithmetic_v<T1> && std::is_arithmetic_v<T2>
bool isZero (T1 value, T2 tolerance=iv::constants::maths::Precision)
 
template<typename T >
requires std::is_arithmetic_v<T>
bool isInRange (T value, T min, T max)
 Checks if a value is in a range [min, max] (inclusive).
 

Function Documentation

◆ degreeToRadian()

iv::types::radian iv::math::utils::degreeToRadian ( iv::types::degree degree)

◆ isEqual()

template<typename T1 , typename T2 , typename T3 = double>
requires std::is_arithmetic_v<T1> && std::is_arithmetic_v<T2> && std::is_arithmetic_v<T3>
bool iv::math::utils::isEqual ( T1 d1,
T2 d2,
T3 tolerance = iv::constants::maths::Precision )

◆ isInRange()

template<typename T >
requires std::is_arithmetic_v<T>
bool iv::math::utils::isInRange ( T value,
T min,
T max )
inline

Checks if a value is in a range [min, max] (inclusive).

Template Parameters
T
Parameters
valueThe value to check.
minThe minimum value of the range.
maxThe maximum value of the range.
Returns
True if the value is in the range, false otherwise.

◆ isSameSign()

bool iv::math::utils::isSameSign ( const double value1,
const double value2,
const double precision )

◆ isZero()

template<typename T1 , typename T2 = double>
requires std::is_arithmetic_v<T1> && std::is_arithmetic_v<T2>
bool iv::math::utils::isZero ( T1 value,
T2 tolerance = iv::constants::maths::Precision )

◆ mmToDp()

int64_t iv::math::utils::mmToDp ( int64_t sizeMm)

◆ pointOnCircle()

iv::math::geometry::Point2d iv::math::utils::pointOnCircle ( iv::types::radius radius,
iv::types::degree angle )

◆ radianToDegree()

iv::types::degree iv::math::utils::radianToDegree ( iv::types::radian radian)

◆ roundToDecimals()

template<typename T >
requires std::is_floating_point_v<T>
T iv::math::utils::roundToDecimals ( T value,
uint8_t decimals )

◆ roundToNearestStep()

double iv::math::utils::roundToNearestStep ( double value,
const double step,
iv::types::Range< double > range )

◆ stepsIncrement()

double iv::math::utils::stepsIncrement ( const iv::types::Range< double > range,
const uint64_t steps )

◆ valueInterpolation()

double iv::math::utils::valueInterpolation ( double valueNormalized,
double valueMin,
double valueMax )