Golias Engine
A C++ 20 'game engine' built with SDL3 with wide platform support.
Functions | Variables
math Namespace Reference

Functions

float sin (float x)
 
float cos (float x)
 
float tan (float x)
 
float asin (float x)
 
float acos (float x)
 
float atan (float x)
 
float atan2 (float y, float x)
 
float sinh (float x)
 
float cosh (float x)
 
float tanh (float x)
 
float exp (float x)
 
float log (float x)
 
float log2 (float x)
 
float log10 (float x)
 
float pow (float base, float exp)
 
float sqrt (float x)
 
float cbrt (float x)
 
float floor (float x)
 
float ceil (float x)
 
float round (float x)
 
float trunc (float x)
 
float abs (float x)
 
int abs (int x)
 
float deg2rad (float degrees)
 
float rad2deg (float radians)
 
bool is_zero_approx (float x)
 
bool is_equal_approx (float a, float b)
 
float random (float min_val, float max_val)
 
int random (int min_val, int max_val)
 
float snap (float value, float step)
 
template<typename T >
min (T a, T b)
 
template<typename T >
max (T a, T b)
 
template<typename T >
clamp (T value, T min_val, T max_val)
 
template<typename T >
sign (T x)
 
template<typename T >
lerp (T a, T b, float t)
 
template<typename T >
smoothstep (T edge0, T edge1, T x)
 
template<typename T >
move_toward (T current, T target, T delta)
 

Variables

constexpr float PI = 3.14159265358979323846f
 
constexpr float TAU = 6.28318530717958647692f
 
constexpr float E = 2.71828182845904523536f
 
constexpr float DEG2RAD = PI / 180.0f
 
constexpr float RAD2DEG = 180.0f / PI
 
constexpr float EPSILON = 1e-6f
 
constexpr float INF = __builtin_huge_valf()
 

Function Documentation

◆ abs() [1/2]

float math::abs ( float  x)

◆ abs() [2/2]

int math::abs ( int  x)

◆ acos()

float math::acos ( float  x)

◆ asin()

float math::asin ( float  x)

◆ atan()

float math::atan ( float  x)

◆ atan2()

float math::atan2 ( float  y,
float  x 
)

◆ cbrt()

float math::cbrt ( float  x)

◆ ceil()

float math::ceil ( float  x)

◆ clamp()

template<typename T >
T math::clamp ( value,
min_val,
max_val 
)
inline

◆ cos()

float math::cos ( float  x)

◆ cosh()

float math::cosh ( float  x)

◆ deg2rad()

float math::deg2rad ( float  degrees)

◆ exp()

float math::exp ( float  x)

◆ floor()

float math::floor ( float  x)

◆ is_equal_approx()

bool math::is_equal_approx ( float  a,
float  b 
)

◆ is_zero_approx()

bool math::is_zero_approx ( float  x)

◆ lerp()

template<typename T >
T math::lerp ( a,
b,
float  t 
)
inline

◆ log()

float math::log ( float  x)

◆ log10()

float math::log10 ( float  x)

◆ log2()

float math::log2 ( float  x)

◆ max()

template<typename T >
T math::max ( a,
b 
)
inline

◆ min()

template<typename T >
T math::min ( a,
b 
)
inline

◆ move_toward()

template<typename T >
T math::move_toward ( current,
target,
delta 
)
inline

◆ pow()

float math::pow ( float  base,
float  exp 
)

◆ rad2deg()

float math::rad2deg ( float  radians)

◆ random() [1/2]

float math::random ( float  min_val,
float  max_val 
)

◆ random() [2/2]

int math::random ( int  min_val,
int  max_val 
)

◆ round()

float math::round ( float  x)

◆ sign()

template<typename T >
T math::sign ( x)
inline

◆ sin()

float math::sin ( float  x)

◆ sinh()

float math::sinh ( float  x)

◆ smoothstep()

template<typename T >
T math::smoothstep ( edge0,
edge1,
x 
)
inline

◆ snap()

float math::snap ( float  value,
float  step 
)

◆ sqrt()

float math::sqrt ( float  x)

◆ tan()

float math::tan ( float  x)

◆ tanh()

float math::tanh ( float  x)

◆ trunc()

float math::trunc ( float  x)

Variable Documentation

◆ DEG2RAD

constexpr float math::DEG2RAD = PI / 180.0f
constexpr

◆ E

constexpr float math::E = 2.71828182845904523536f
constexpr

◆ EPSILON

constexpr float math::EPSILON = 1e-6f
constexpr

◆ INF

constexpr float math::INF = __builtin_huge_valf()
constexpr

◆ PI

constexpr float math::PI = 3.14159265358979323846f
constexpr

◆ RAD2DEG

constexpr float math::RAD2DEG = 180.0f / PI
constexpr

◆ TAU

constexpr float math::TAU = 6.28318530717958647692f
constexpr