FifeGUI 0.2.0
A C++ GUI library designed for games.
fcn::Math< T > Class Template Reference

#include <math.hpp>

Public Types

using num_type = T
using traits_type = float_traits<num_type>

Static Public Member Functions

static T ACos (T _val)
static T ASin (T _val)
static T ATan (T _val)
static T ATan2 (T _x, T _y)
static T Ceil (T _val)
static T Cos (T _val)
static num_type degToRad ()
static num_type epsilon ()
static bool Equal (T _val1, T _val2)
static T Exp (T _val)
static T FAbs (T _val)
static T Floor (T _val)
static T FMod (T _x, T _y)
static num_type halfPi ()
static num_type inversePi ()
static num_type inverseTwoPi ()
static num_type invLog10 ()
static num_type invLog2 ()
static T InvSqrt (T _val)
static T Log (T _val)
static T Log10 (T _val)
static num_type log10 ()
static T Log2 (T _val)
static num_type log2 ()
static num_type max ()
static num_type pi ()
static T Pow (T _base, T _exponent)
static num_type radToDeg ()
static T Sin (T _val)
static T Sqr (T _val)
static T Sqrt (T _val)
static T Tan (T _val)
static num_type twoPi ()
static num_type zeroTolerance ()

Detailed Description

template<typename T>
class fcn::Math< T >

Template utility providing math functions and constants for numeric type T.

Utility math functions and constants templated on numeric type T. Use Mathf and Mathd for float and double respectively.

Definition at line 233 of file math.hpp.

Member Typedef Documentation

◆ num_type

template<typename T>
using fcn::Math< T >::num_type = T

Type definitions.

Definition at line 239 of file math.hpp.

◆ traits_type

template<typename T>
using fcn::Math< T >::traits_type = float_traits<num_type>

Trait alias providing numeric constants and helpers for num_type.

Definition at line 242 of file math.hpp.

Member Function Documentation

◆ ACos()

template<typename T>
T fcn::Math< T >::ACos ( T _val)
inlinestatic

Arc cosine (clamped).

Definition at line 393 of file math.hpp.

References pi().

◆ ASin()

template<class T>
T fcn::Math< T >::ASin ( T _val)
inlinestatic

Arc sine (clamped).

Definition at line 407 of file math.hpp.

References halfPi().

◆ ATan()

template<class T>
T fcn::Math< T >::ATan ( T _val)
inlinestatic

Arc tangent.

Definition at line 421 of file math.hpp.

◆ ATan2()

template<class T>
T fcn::Math< T >::ATan2 ( T _x,
T _y )
inlinestatic

Two-argument arc tangent.

Definition at line 427 of file math.hpp.

◆ Ceil()

template<class T>
T fcn::Math< T >::Ceil ( T _val)
inlinestatic

Ceiling of value.

Definition at line 433 of file math.hpp.

◆ Cos()

template<class T>
T fcn::Math< T >::Cos ( T _val)
inlinestatic

Cosine of value.

Definition at line 439 of file math.hpp.

◆ degToRad()

template<typename T>
num_type fcn::Math< T >::degToRad ( )
inlinestatic

Degrees-to-radians factor.

Definition at line 293 of file math.hpp.

◆ epsilon()

template<typename T>
num_type fcn::Math< T >::epsilon ( )
inlinestatic

Returns machine epsilon for the numeric type.

Definition at line 245 of file math.hpp.

Referenced by Equal().

◆ Equal()

template<class T>
bool fcn::Math< T >::Equal ( T _val1,
T _val2 )
inlinestatic

Approximate equality check using epsilon.

Definition at line 523 of file math.hpp.

References epsilon().

◆ Exp()

template<class T>
T fcn::Math< T >::Exp ( T _val)
inlinestatic

Exponential e^x.

Definition at line 445 of file math.hpp.

◆ FAbs()

template<class T>
T fcn::Math< T >::FAbs ( T _val)
inlinestatic

Absolute value (floating).

Definition at line 451 of file math.hpp.

◆ Floor()

template<class T>
T fcn::Math< T >::Floor ( T _val)
inlinestatic

Floor of value.

Definition at line 457 of file math.hpp.

◆ FMod()

template<class T>
T fcn::Math< T >::FMod ( T _x,
T _y )
inlinestatic

Floating-point modulus.

Definition at line 463 of file math.hpp.

◆ halfPi()

template<typename T>
num_type fcn::Math< T >::halfPi ( )
inlinestatic

Half of pi.

Definition at line 275 of file math.hpp.

Referenced by ASin().

◆ inversePi()

template<typename T>
num_type fcn::Math< T >::inversePi ( )
inlinestatic

1/pi constant.

Definition at line 281 of file math.hpp.

◆ inverseTwoPi()

template<typename T>
num_type fcn::Math< T >::inverseTwoPi ( )
inlinestatic

1/(2*pi) constant.

Definition at line 287 of file math.hpp.

◆ invLog10()

template<typename T>
num_type fcn::Math< T >::invLog10 ( )
inlinestatic

1/ln(10) helper.

Definition at line 323 of file math.hpp.

Referenced by Log10().

◆ invLog2()

template<typename T>
num_type fcn::Math< T >::invLog2 ( )
inlinestatic

1/ln(2) helper.

Definition at line 317 of file math.hpp.

Referenced by Log2().

◆ InvSqrt()

template<class T>
T fcn::Math< T >::InvSqrt ( T _val)
inlinestatic

Inverse square root (1/sqrt(x)).

Definition at line 469 of file math.hpp.

◆ Log()

template<class T>
T fcn::Math< T >::Log ( T _val)
inlinestatic

Natural logarithm.

Definition at line 475 of file math.hpp.

◆ Log10()

template<class T>
T fcn::Math< T >::Log10 ( T _val)
inlinestatic

Log base 10.

Definition at line 486 of file math.hpp.

References invLog10().

◆ log10()

template<typename T>
num_type fcn::Math< T >::log10 ( )
inlinestatic

Natural log base 10.

Definition at line 311 of file math.hpp.

◆ Log2()

template<class T>
T fcn::Math< T >::Log2 ( T _val)
inlinestatic

Log base 2.

Definition at line 481 of file math.hpp.

References invLog2().

◆ log2()

template<typename T>
num_type fcn::Math< T >::log2 ( )
inlinestatic

Natural log base 2.

Definition at line 305 of file math.hpp.

◆ max()

template<typename T>
num_type fcn::Math< T >::max ( )
inlinestatic

Maximum finite value for the numeric type.

Definition at line 257 of file math.hpp.

◆ pi()

template<typename T>
num_type fcn::Math< T >::pi ( )
inlinestatic

Pi constant.

Definition at line 263 of file math.hpp.

Referenced by ACos().

◆ Pow()

template<class T>
T fcn::Math< T >::Pow ( T _base,
T _exponent )
inlinestatic

Power function.

Definition at line 493 of file math.hpp.

◆ radToDeg()

template<typename T>
num_type fcn::Math< T >::radToDeg ( )
inlinestatic

Radians-to-degrees factor.

Definition at line 299 of file math.hpp.

◆ Sin()

template<class T>
T fcn::Math< T >::Sin ( T _val)
inlinestatic

Sine of value.

Definition at line 499 of file math.hpp.

◆ Sqr()

template<class T>
T fcn::Math< T >::Sqr ( T _val)
inlinestatic

Square of value.

Definition at line 505 of file math.hpp.

◆ Sqrt()

template<class T>
T fcn::Math< T >::Sqrt ( T _val)
inlinestatic

Square root.

Definition at line 511 of file math.hpp.

◆ Tan()

template<class T>
T fcn::Math< T >::Tan ( T _val)
inlinestatic

Tangent of value.

Definition at line 517 of file math.hpp.

◆ twoPi()

template<typename T>
num_type fcn::Math< T >::twoPi ( )
inlinestatic

Two times pi.

Definition at line 269 of file math.hpp.

◆ zeroTolerance()

template<typename T>
num_type fcn::Math< T >::zeroTolerance ( )
inlinestatic

Recommended zero tolerance for comparisons.

Definition at line 251 of file math.hpp.


The documentation for this class was generated from the following file: