HiveMind
Functions | Variables
Math Namespace Reference

Namespace that provides basic mathematical operations. Optized for the platform. More...

Functions

float cos (float x)
 calculate the cosine More...
 
float sin (float x)
 calculate the sine More...
 
float tan (float x)
 calculate the tangent More...
 
float acos (float x)
 calculate the arc cosine More...
 
float asin (float x)
 calculate the arc sine More...
 
float atan (float x)
 calculate the arc tangent More...
 
float atan2 (float y, float x)
 calculate the arc of x/y More...
 
float pow (float base, float exponent)
 Calculates the base raised to the power of the exponent. More...
 
float sqrt (float x)
 Calculates the square root. More...
 
float cbrt (float x)
 Calculates the cube root. More...
 
float exp (float x)
 Calculates the exponent. More...
 
float ln (float x)
 Calculates the natural logarithm. More...
 
float log10 (float x)
 Calculates the logarithm base 10. More...
 
float log2 (float x)
 Calculates the logarithm base 2. More...
 
float ceil (float x)
 Round x upward. More...
 
float floor (float x)
 Floor x downward. More...
 
float fmod (float numer, float denom)
 Calculates the remainder of numer/denom. More...
 
float round (float x)
 Round x. More...
 
float fdim (float x, float y)
 Returns the positive difference between x and y. More...
 
float fmax (float x, float y)
 Return the larger of it's arguments, either x or y. More...
 
float fmin (float x, float y)
 Return the minimum of it's arguments, either x or y. More...
 
float fabs (float x)
 Return the absolute value. More...
 
int abs (int x)
 Return the absolute value. More...
 

Variables

const float pi = M_PI
 
const float e = M_E
 

Detailed Description

Namespace that provides basic mathematical operations. Optized for the platform.

Function Documentation

◆ abs()

int Math::abs ( int  x)

Return the absolute value.

Parameters
xvalue whose absolute value is returned
Returns
the absolute value value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ acos()

float Math::acos ( float  x)

calculate the arc cosine

Parameters
xvalue to compute, interval of [-1, +1]. An error occur if out of the interval
Returns
the arc cosine of x in radians [0, pi]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ asin()

float Math::asin ( float  x)

calculate the arc sine

Parameters
xvalue to compute, interval of [-1, +1]. An error occur if out of the interval
Returns
the arc sine of x in radians [0, pi]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atan()

float Math::atan ( float  x)

calculate the arc tangent

Parameters
xvalue to compute.
Returns
the arc tangent of x in radians [-pi/2, pi/2]
Here is the call graph for this function:

◆ atan2()

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

calculate the arc of x/y

Parameters
yvalue representing the y coordinate
xvalue representing the x coordinate
Returns
the arc tangent of y/x in radians [-pi, pi]
Here is the caller graph for this function:

◆ cbrt()

float Math::cbrt ( float  x)

Calculates the cube root.

Parameters
xthe value to cube root. If x is negative, an error occure
Returns
the cube root of x

◆ ceil()

float Math::ceil ( float  x)

Round x upward.

Parameters
xthe value to round up
Returns
the smallest integral value that is not less than x (as float)
Here is the caller graph for this function:

◆ cos()

float Math::cos ( float  x)

calculate the cosine

Parameters
xvalue in radian
Returns
the cosine of x radians
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exp()

float Math::exp ( float  x)

Calculates the exponent.

Parameters
xthe value of the exponent
Returns
the value of the exponent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fabs()

float Math::fabs ( float  x)

Return the absolute value.

Parameters
xvalue whose absolute value is returned
Returns
the absolute value value
Here is the caller graph for this function:

◆ fdim()

float Math::fdim ( float  x,
float  y 
)

Returns the positive difference between x and y.

Parameters
xthe value to be subtracted
ythe value to subtract
Returns
x-y if x>y. zero otherwise

◆ floor()

float Math::floor ( float  x)

Floor x downward.

Parameters
xthe value to floor down
Returns
the smallest integral value that is not greater than x (as float)
Here is the caller graph for this function:

◆ fmax()

float Math::fmax ( float  x,
float  y 
)

Return the larger of it's arguments, either x or y.

Parameters
xone of the value to select the maximum
yone of the value to select the maximum
Returns
the maximum value of it's arguments

◆ fmin()

float Math::fmin ( float  x,
float  y 
)

Return the minimum of it's arguments, either x or y.

Parameters
xone of the value to select the minimum
yone of the value to select the minimum
Returns
the minimum value of it's arguments

◆ fmod()

float Math::fmod ( float  numer,
float  denom 
)

Calculates the remainder of numer/denom.

Parameters
numerthe quotient numerator
denomthe quotient denominator of 0, an error occurs
Returns
the remainder of divinding the argument

◆ ln()

float Math::ln ( float  x)

Calculates the natural logarithm.

Parameters
xthe value whose logarithm is calculated
Returns
the natural logarithm of x
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log10()

float Math::log10 ( float  x)

Calculates the logarithm base 10.

Parameters
xthe value whose logarithm is calculated
Returns
the logarithm base 10 of x
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log2()

float Math::log2 ( float  x)

Calculates the logarithm base 2.

Parameters
xthe value whose logarithm is calculated
Returns
the logarithm base 2 of x
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pow()

float Math::pow ( float  base,
float  exponent 
)

Calculates the base raised to the power of the exponent.

Parameters
basethe base value
exponentthe exponent value
Returns
the base raised to the power of the exponent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ round()

float Math::round ( float  x)

Round x.

Parameters
xthe value to round
Returns
the value of x rounded to the nearest integral (as float)

◆ sin()

float Math::sin ( float  x)

calculate the sine

Parameters
xvalue in radian
Returns
the sine of x radians
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sqrt()

float Math::sqrt ( float  x)

Calculates the square root.

Parameters
xthe value to square root. If x is negative, an error occure
Returns
the square root of x
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tan()

float Math::tan ( float  x)

calculate the tangent

Parameters
xvalue in radian
Returns
the tangent of x radians
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ e

const float Math::e = M_E

◆ pi

const float Math::pi = M_PI