SaturnRingLibrary 0.6
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::Math Class Reference

Detailed Description

Math functions.

#include <srl_math.hpp>

Classes

class  Random
 Pseudo-Random number generator. More...
 

Static Public Member Functions

template<typename ValueType >
static constexpr ValueType Abs (const ValueType &value)
 Get absolute value.
 
template<typename ValueType >
static constexpr ValueType Clamp (const ValueType &minimum, const ValueType &maximum, const ValueType &value)
 Clamp value in the range.
 
static const Types::Fxp Cos (Types::Angle angle)
 Cosine operation.
 
template<typename ValueType >
static constexpr ValueType Max (const ValueType &first, const ValueType &second)
 Get maximum value of two values.
 
template<typename ValueType >
static constexpr ValueType Min (const ValueType &first, const ValueType &second)
 Get minimum value of two values.
 
static const Types::Fxp Sin (Types::Angle angle)
 Sinus operation.
 
static SRL::Types::Fxp Tan (const SRL::Types::Angle &angle)
 Tangent from angle.
 

Member Function Documentation

◆ Abs()

template<typename ValueType >
static constexpr ValueType SRL::Math::Abs ( const ValueType & value)
inlinestaticconstexpr

Get absolute value.

Template Parameters
ValueTypeType of the value
Parameters
valueNumeric value
Returns
Absolute value

◆ Clamp()

template<typename ValueType >
static constexpr ValueType SRL::Math::Clamp ( const ValueType & minimum,
const ValueType & maximum,
const ValueType & value )
inlinestaticconstexpr

Clamp value in the range.

Template Parameters
ValueTypeType of the value
Parameters
minimumMinimum of the range
maximumMaximum of the range
valueValue to clamp
Returns
Clamped value

◆ Cos()

static const Types::Fxp SRL::Math::Cos ( Types::Angle angle)
inlinestatic

Cosine operation.

Parameters
angleAngle value
Returns
Cosine value

◆ Max()

template<typename ValueType >
static constexpr ValueType SRL::Math::Max ( const ValueType & first,
const ValueType & second )
inlinestaticconstexpr

Get maximum value of two values.

Template Parameters
ValueTypeType of the value
Parameters
firstFirst value
secondSecond value
Returns
Maximum value

◆ Min()

template<typename ValueType >
static constexpr ValueType SRL::Math::Min ( const ValueType & first,
const ValueType & second )
inlinestaticconstexpr

Get minimum value of two values.

Template Parameters
ValueTypeType of the value
Parameters
firstFirst value
secondSecond value
Returns
Minimum value

◆ Sin()

static const Types::Fxp SRL::Math::Sin ( Types::Angle angle)
inlinestatic

Sinus operation.

Parameters
angleAngle value
Returns
Sinus value

◆ Tan()

static SRL::Types::Fxp SRL::Math::Tan ( const SRL::Types::Angle & angle)
inlinestatic

Tangent from angle.

Parameters
angleAngle value
Returns
Tangent value