FifeGUI 0.3.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 237 of file math.hpp.

Member Typedef Documentation

◆ num_type

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

Type definitions.

Definition at line 243 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 246 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 404 of file math.hpp.

References pi().

◆ ASin()

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

Arc sine (clamped).

Definition at line 418 of file math.hpp.

References halfPi().

◆ ATan()

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

Arc tangent.

Definition at line 432 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 438 of file math.hpp.

◆ Ceil()

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

Ceiling of value.

Definition at line 444 of file math.hpp.

◆ Cos()

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

Cosine of value.

Definition at line 450 of file math.hpp.

◆ degToRad()

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

Degrees-to-radians factor.

Definition at line 297 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 249 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 533 of file math.hpp.

References epsilon().

◆ Exp()

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

Exponential e^x.

Definition at line 456 of file math.hpp.

◆ FAbs()

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

Absolute value (floating).

Definition at line 462 of file math.hpp.

◆ Floor()

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

Floor of value.

Definition at line 468 of file math.hpp.

◆ FMod()

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

Floating-point modulus.

Definition at line 474 of file math.hpp.

◆ halfPi()

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

Half of pi.

Definition at line 279 of file math.hpp.

Referenced by ASin().

◆ inversePi()

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

1/pi constant.

Definition at line 285 of file math.hpp.

◆ inverseTwoPi()

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

1/(2*pi) constant.

Definition at line 291 of file math.hpp.

◆ invLog10()

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

1/ln(10) helper.

Definition at line 327 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 321 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 480 of file math.hpp.

◆ Log()

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

Natural logarithm.

Definition at line 486 of file math.hpp.

◆ Log10()

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

Log base 10.

Definition at line 497 of file math.hpp.

References invLog10().

◆ log10()

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

Natural log base 10.

Definition at line 315 of file math.hpp.

◆ Log2()

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

Log base 2.

Definition at line 492 of file math.hpp.

References invLog2().

◆ log2()

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

Natural log base 2.

Definition at line 309 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 261 of file math.hpp.

◆ pi()

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

Pi constant.

Definition at line 267 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 503 of file math.hpp.

◆ radToDeg()

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

Radians-to-degrees factor.

Definition at line 303 of file math.hpp.

◆ Sin()

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

Sine of value.

Definition at line 509 of file math.hpp.

◆ Sqr()

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

Square of value.

Definition at line 515 of file math.hpp.

◆ Sqrt()

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

Square root.

Definition at line 521 of file math.hpp.

◆ Tan()

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

Tangent of value.

Definition at line 527 of file math.hpp.

◆ twoPi()

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

Two times pi.

Definition at line 273 of file math.hpp.

◆ zeroTolerance()

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

Recommended zero tolerance for comparisons.

Definition at line 255 of file math.hpp.


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