math
[utils]

Mathematics and Trigonometric functions. More...

Modules

 math2d
 

2D Mathematics functions


 math3d
 

3D Mathematics functions


Defines

#define FIX_ONE
#define INT2FIX(v)
#define FLT2FIX(v)
#define FIX2INT(v)
#define FIX2FLT(v)
#define FIX_EPSILON
#define FIX_MAX
#define FIX_MIN
#define GF_PI2
#define GF_PI
#define GF_2PI
#define gf_invfix(_a)
#define gf_mulfix(_a, _b)
#define gf_muldiv(_a, _b, _c)
#define gf_divfix(_a, _b)
#define gf_sqrt(_a)
#define gf_ceil(_a)
#define gf_floor(_a)
#define gf_cos(_a)
#define gf_sin(_a)
#define gf_tan(_a)
#define gf_atan2(_y, _x)
#define gf_acos(_a)
#define gf_asin(_a)

Typedefs

typedef Float Fixed

Functions

Fixed gf_angle_diff (Fixed a, Fixed b)
u32 gf_get_bit_size (u32 MaxVal)
 Field bit-size.
u32 gf_get_next_pow2 (u32 val)
 Get power of 2.

Detailed Description

This section documents the math and trigo functions used in the GPAC framework. GPAC can be compiled with fixed-point support, representing float values on a 16.16 signed integer, which implies a developer must take care of float computations when using GPAC.
A developper should not need to know in which mode the framework has been compiled as long as he uses the math functions of GPAC which work in both float and fixed-point mode.
Using fixed-point version is decided at compilation time and cannot be changed. The feature is signaled through the following macros:


Define Documentation

#define FIX_ONE

Fixed unit value

#define INT2FIX (  ) 

Conversion from integer to fixed

#define FLT2FIX (  ) 

Conversion from float to fixed

#define FIX2INT (  ) 

Conversion from fixed to integer

#define FIX2FLT (  ) 

Conversion from fixed to float

#define FIX_EPSILON

Epsilon Fixed (positive value closest to 0)

#define FIX_MAX

Maximum Fixed (maximum representable fixed value)

#define FIX_MIN

Minimum Fixed (minimum representable fixed value)

#define GF_PI2

PI/2 expressed as Fixed

#define GF_PI

PI expressed as Fixed

#define GF_2PI

2*PI expressed as Fixed

#define gf_invfix ( _a   ) 

1/_a, expressed as fixed number

#define gf_mulfix ( _a,
_b   ) 

_a*_b, expressed as fixed number

#define gf_muldiv ( _a,
_b,
_c   ) 

_a*_b/_c, expressed as fixed number

#define gf_divfix ( _a,
_b   ) 

_a/_b, expressed as fixed number

#define gf_sqrt ( _a   ) 

sqrt(_a), expressed as fixed number

#define gf_ceil ( _a   ) 

ceil(_a), expressed as fixed number

#define gf_floor ( _a   ) 

floor(_a), expressed as fixed number

#define gf_cos ( _a   ) 

cos(_a), expressed as fixed number

#define gf_sin ( _a   ) 

sin(_a), expressed as fixed number

#define gf_tan ( _a   ) 

tan(_a), expressed as fixed number

#define gf_atan2 ( _y,
_x   ) 

atan2(_y,_x), expressed as fixed number

#define gf_acos ( _a   ) 

acos(_a), expressed as fixed number

#define gf_asin ( _a   ) 

asin(_a), expressed as fixed number


Typedef Documentation

typedef Float Fixed

Fixed is 32bit float number

Note:
This documentation has been generated for a float version of the GPAC framework.

Function Documentation

u32 gf_get_bit_size ( u32  MaxVal  ) 

Gets the number of bits needed to represent the value.

Parameters:
MaxVal Maximum value to be represented.
Returns:
number of bits required to represent the value.
u32 gf_get_next_pow2 ( u32  val  ) 

Gets the closest power of 2 greater or equal to the value.

Parameters:
val value to be used.
Returns:
requested power of 2.

Generated on 16 Aug 2011 for libgpac by  doxygen 1.6.1