Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

syn::Math Namespace Reference


Compounds

struct  syn::Math::ADDEQUAL
 operator+=. More...

struct  syn::Math::EQUAL
 operator=. More...

struct  syn::Math::MULTEQUAL
 operator *=. More...


Functions

T Min (const T &x, const T &y)
 min returns the minimum of 2 values. More...

T Min (const T &x, const T &y, const T &z)
 min returns the minimum of 3 values. More...

T Min (const T &w, const T &x, const T &y, const T &z)
 min returns the minimum of 4 values. More...

T Max (const T &x, const T &y)
 max returns the maximum of 2 values. More...

T Max (const T &x, const T &y, const T &z)
 max returns the maximum of 3 values. More...

T Max (const T &w, const T &x, const T &y, const T &z)
 max returns the maximum of 4 values. More...

void lerp (T &result, const U &lerp, const T &a, const T &b)
 Linear Interpolation between number [a] and [b] use double or float only... More...

T trunc (T val)
 cut off the digits after the decimal place. More...

T round (T p)
 round to nearest integer. More...

T aCos (T fValue)
 return a random number between x1 and x2 RETURNS: random number between x1 and x2. More...

float aCos (float fValue)
double aCos (double fValue)
T aSin (T fValue)
float aSin (float fValue)
double aSin (double fValue)
T aTan (T fValue)
float aTan (float fValue)
double aTan (double fValue)
T atan2 (T fY, T fX)
float aTan2 (float fY, float fX)
double aTan2 (double fY, double fX)
T cos (T fValue)
float cos (float fValue)
double cos (double fValue)
T exp (T fValue)
float exp (float fValue)
double exp (double fValue)
T log (T fValue)
double log (double fValue)
float log (float fValue)
double pow (double fBase, double fExponent)
float pow (float fBase, float fExponent)
T sin (T fValue)
double sin (double fValue)
float sin (float fValue)
T tan (T fValue)
double tan (double fValue)
float tan (float fValue)
T sqr (T fValue)
T sqrt (T fValue)
double sqrt (double fValue)
T abs (T iValue)
double fast_exp2 (const double val)
 Linear approx. More...

float fast_log2 (const float f)
 This code uses IEEE 32-bit floating point representation knowledge to quickly compute approximations to the log2 of a value. More...

T log2 (const T f)
 log base 2. More...

float volumeToDB (float vol)
float DBtoVolume (float db)

Variables

const float PI = 3.14159265358979323846f
const float PI_OVER_2 = 1.57079632679489661923f
const float PI_OVER_4 = 0.78539816339744830962f


Function Documentation

T syn::Math::Min ( const T & x,
const T & y ) [inline]
 

min returns the minimum of 2 values.

Definition at line 55 of file Math.h.

T syn::Math::Min ( const T & x,
const T & y,
const T & z ) [inline]
 

min returns the minimum of 3 values.

Definition at line 61 of file Math.h.

T syn::Math::Min ( const T & w,
const T & x,
const T & y,
const T & z ) [inline]
 

min returns the minimum of 4 values.

Definition at line 67 of file Math.h.

T syn::Math::Max ( const T & x,
const T & y ) [inline]
 

max returns the maximum of 2 values.

Definition at line 74 of file Math.h.

T syn::Math::Max ( const T & x,
const T & y,
const T & z ) [inline]
 

max returns the maximum of 3 values.

Definition at line 80 of file Math.h.

T syn::Math::Max ( const T & w,
const T & x,
const T & y,
const T & z ) [inline]
 

max returns the maximum of 4 values.

Definition at line 86 of file Math.h.

void syn::Math::lerp ( T & result,
const U & lerp,
const T & a,
const T & b ) [inline]
 

Linear Interpolation between number [a] and [b] use double or float only...

Definition at line 94 of file Math.h.

T syn::Math::trunc ( T val ) [inline]
 

cut off the digits after the decimal place.

Definition at line 102 of file Math.h.

T syn::Math::round ( T p ) [inline]
 

round to nearest integer.

Definition at line 108 of file Math.h.

T syn::Math::aCos ( T fValue ) [inline]
 

return a random number between x1 and x2 RETURNS: random number between x1 and x2.

float syn::Math::aCos ( float fValue ) [inline]
 

Definition at line 140 of file Math.h.

double syn::Math::aCos ( double fValue ) [inline]
 

Definition at line 154 of file Math.h.

T syn::Math::aSin ( T fValue ) [inline]
 

float syn::Math::aSin ( float fValue ) [inline]
 

Definition at line 171 of file Math.h.

double syn::Math::aSin ( double fValue ) [inline]
 

Definition at line 185 of file Math.h.

T syn::Math::aTan ( T fValue ) [inline]
 

float syn::Math::aTan ( float fValue ) [inline]
 

Definition at line 201 of file Math.h.

double syn::Math::aTan ( double fValue ) [inline]
 

Definition at line 205 of file Math.h.

T syn::Math::atan2 ( T fY,
T fX ) [inline]
 

Referenced by aTan2().

float syn::Math::aTan2 ( float fY,
float fX ) [inline]
 

Definition at line 212 of file Math.h.

double syn::Math::aTan2 ( double fY,
double fX ) [inline]
 

Definition at line 216 of file Math.h.

T syn::Math::cos ( T fValue ) [inline]
 

Referenced by cos().

float syn::Math::cos ( float fValue ) [inline]
 

Definition at line 223 of file Math.h.

double syn::Math::cos ( double fValue ) [inline]
 

Definition at line 227 of file Math.h.

T syn::Math::exp ( T fValue ) [inline]
 

Referenced by exp().

float syn::Math::exp ( float fValue ) [inline]
 

Definition at line 234 of file Math.h.

double syn::Math::exp ( double fValue ) [inline]
 

Definition at line 238 of file Math.h.

T syn::Math::log ( T fValue ) [inline]
 

Referenced by log().

double syn::Math::log ( double fValue ) [inline]
 

Definition at line 245 of file Math.h.

float syn::Math::log ( float fValue ) [inline]
 

Definition at line 249 of file Math.h.

double syn::Math::pow ( double fBase,
double fExponent ) [inline]
 

Definition at line 254 of file Math.h.

float syn::Math::pow ( float fBase,
float fExponent ) [inline]
 

Definition at line 258 of file Math.h.

T syn::Math::sin ( T fValue ) [inline]
 

Referenced by sin().

double syn::Math::sin ( double fValue ) [inline]
 

Definition at line 264 of file Math.h.

float syn::Math::sin ( float fValue ) [inline]
 

Definition at line 268 of file Math.h.

T syn::Math::tan ( T fValue ) [inline]
 

Referenced by tan().

double syn::Math::tan ( double fValue ) [inline]
 

Definition at line 274 of file Math.h.

float syn::Math::tan ( float fValue ) [inline]
 

Definition at line 278 of file Math.h.

T syn::Math::sqr ( T fValue ) [inline]
 

Definition at line 283 of file Math.h.

T syn::Math::sqrt ( T fValue ) [inline]
 

Definition at line 288 of file Math.h.

Referenced by sqrt().

double syn::Math::sqrt ( double fValue ) [inline]
 

Definition at line 292 of file Math.h.

T syn::Math::abs ( T iValue ) [inline]
 

Definition at line 298 of file Math.h.

double syn::Math::fast_exp2 ( const double val ) [inline]
 

Linear approx.

between 2 integer values of val. Uses 32-bit integers. Not very efficient but fastest than exp() This code detects both big and little endian processors.

See also:
musicdsp.org

Definition at line 308 of file Math.h.

float syn::Math::fast_log2 ( const float f ) [inline]
 

This code uses IEEE 32-bit floating point representation knowledge to quickly compute approximations to the log2 of a value.

This function returns an under-estimate of the actual value, although it might be sufficient for using in, say, a dBV/FS level meter.

See also:
musicdsp.org

Definition at line 354 of file Math.h.

T syn::Math::log2 ( const T f ) [inline]
 

log base 2.

Definition at line 366 of file Math.h.

float syn::Math::volumeToDB ( float vol ) [inline]
 

Definition at line 395 of file Math.h.

float syn::Math::DBtoVolume ( float db ) [inline]
 

Definition at line 415 of file Math.h.


Variable Documentation

const float syn::Math::PI = 3.14159265358979323846f
 

Definition at line 48 of file Math.h.

const float syn::Math::PI_OVER_2 = 1.57079632679489661923f
 

Definition at line 49 of file Math.h.

const float syn::Math::PI_OVER_4 = 0.78539816339744830962f
 

Definition at line 50 of file Math.h.


Generated at Mon Apr 15 09:28:12 2002 for subsynth by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001