VFPU Math Library


Data Structures

struct  pgeRect2

Functions

float pgeMathAbs (float x)
float pgeMathCeil (float x)
float pgeMathFloor (float x)
float pgeMathAtan (float x)
float pgeMathAtan2 (float y, float x)
float pgeMathSqrt (float x)
float pgeMathCos (float rad)
float pgeMathSin (float rad)
float pgeMathAcos (float x)
float pgeMathAsin (float x)
float pgeMathCosh (float x)
float pgeMathExp (float x)
float pgeMathFmax (float x, float y)
float pgeMathFmin (float x, float y)
float pgeMathFmod (float x, float y)
float pgeMathLog (float x)
float pgeMathLog2 (float x)
float pgeMathLog10 (float x)
float pgeMathPow (float x, float y)
float pgeMathPow2 (float x)
float pgeMathRound (float x)
float pgeMathTrunc (float x)
void pgeMathSrand (unsigned int x)
float pgeMathRandFloat (float min, float max)
int pgeMathRandInt (float min, float max)
void pgeMathSincos (float r, float *s, float *c)
float pgeMathSinh (float x)
float pgeMathTan (float x)
float pgeMathTanh (float x)
float pgeMathInvSqrt (float x)
float pgeMathDegToRad (float x)
float pgeMathRadToDeg (float x)
ScePspFVector3 * pgeMathVecNormalize3f (ScePspFVector3 *result, const ScePspFVector3 *vec)
ScePspFVector3 * pgeMathVecAdd3f (ScePspFVector3 *result, const ScePspFVector3 *vec1, const ScePspFVector3 *vec2)
ScePspFVector3 * pgeMathVecSub3f (ScePspFVector3 *result, const ScePspFVector3 *vec1, const ScePspFVector3 *vec2)
int pgeMathVecCompare3f (const ScePspFVector3 *vec1, const ScePspFVector3 *vec2)
ScePspFVector3 * pgeMathVecScale3f (ScePspFVector3 *result, const ScePspFVector3 *vec, float scalar)
float pgeMathVecDot3f (const ScePspFVector3 *vec1, const ScePspFVector3 *vec2)
float pgeMathVecLength3f (const ScePspFVector3 *vec)
float pgeMathVecAngle3f (const ScePspFVector3 *vec1, const ScePspFVector3 *vec2)
ScePspFVector3 * pgeMathVecRotateZ3f (const ScePspFVector3 *vec, float a, ScePspFVector3 *result)
void pgeMathRectClear (pgeRect2 *rect)
void pgeMathRectSetRadius (pgeRect2 *rect, float x, float y, float r)
void pgeMathRectEncapsulate (pgeRect2 *rect, float x, float y)
int pgeMathRectTestPoint (pgeRect2 *rect, float x, float y)
int pgeMathRectIntersect (pgeRect2 *rect1, pgeRect2 *rect2)

Function Documentation

float pgeMathAbs ( float  x  ) 

Calculate absolute value

Parameters:
x - Input

float pgeMathAcos ( float  x  ) 

Calculate inverse cosine (arccos)

Parameters:
x - Input in radians

float pgeMathAsin ( float  x  ) 

Calculate inverse sine (arcsin)

Parameters:
x - Input in radians

float pgeMathAtan ( float  x  ) 

Calculate inverse tangent (arctan)

Parameters:
x - Input in radians

float pgeMathAtan2 ( float  y,
float  x 
)

Calculate inverse tangent, with quadrant fix-up

Parameters:
y - Input in radians
x - Input in radians

float pgeMathCeil ( float  x  ) 

Round value up

Parameters:
x - Input

float pgeMathCos ( float  rad  ) 

Calculate cosine

Parameters:
x - Input in radians

float pgeMathCosh ( float  x  ) 

Calculate hyperbolic cosine

Parameters:
x - Input in radians

float pgeMathDegToRad ( float  x  ) 

Calculate radian angle from euler angle

Parameters:
x - Input value in degrees

float pgeMathExp ( float  x  ) 

Calculate exponent

Parameters:
x - Input in radians

float pgeMathFloor ( float  x  ) 

Round value down

Parameters:
x - Input

float pgeMathFmax ( float  x,
float  y 
)

Calculate maximum numeric value

Parameters:
x - Input
y - Input

float pgeMathFmin ( float  x,
float  y 
)

Calculate minimum numeric value

Parameters:
x - Input
y - Input

float pgeMathFmod ( float  x,
float  y 
)

Calculate floating point remainder of x/y

Parameters:
x - Input
y - Input

float pgeMathInvSqrt ( float  x  ) 

Calculate inverse square root (1/sqrt(x))

Parameters:
x - Input value

float pgeMathLog ( float  x  ) 

Calculate natural logarithm

Parameters:
x - Input in radians

float pgeMathLog10 ( float  x  ) 

Calculate base 10 logarithm

Parameters:
x - Input in radians

float pgeMathLog2 ( float  x  ) 

Calculate base 2 logarithm

Parameters:
x - Input in radians

float pgeMathPow ( float  x,
float  y 
)

Calculate x raised to the power of y

Parameters:
x - Number to raise power of
y - Power to raise x by

float pgeMathPow2 ( float  x  ) 

Calculate 2 raised to the power of x

Parameters:
x - Input

float pgeMathRadToDeg ( float  x  ) 

Calculate euler angle from radian angle

Parameters:
x - Input value in degrees

float pgeMathRandFloat ( float  min,
float  max 
)

Generate random float value

Parameters:
min - Minimum value to return
max - Maximum value to return
Returns:
A value between min and max

int pgeMathRandInt ( float  min,
float  max 
)

Generate random int value

Parameters:
min - Minimum value to return
max - Maximum value to return
Returns:
A value between min and max

void pgeMathRectClear ( pgeRect2 rect  ) 

Clear a pgeRect2

Parameters:
rect - pointer to a pgeRect2 as Input

void pgeMathRectEncapsulate ( pgeRect2 rect,
float  x,
float  y 
)

Encapsulate a point into a pgeRect2

Parameters:
rect - pointer to a pgeRect2 to be processed
x - float x coordinate
y - float y coordinate

int pgeMathRectIntersect ( pgeRect2 rect1,
pgeRect2 rect2 
)

Test if two pgeRect2 intersect

Parameters:
rect1 - pointer to a pgeRect2 as Input
rect2 - pointer to a pgeRect2 as Input
Returns:
int 1 if rect1 intersects rect2, else 0

void pgeMathRectSetRadius ( pgeRect2 rect,
float  x,
float  y,
float  r 
)

Set the coordinates of a pgeRect2

Parameters:
rect - pointer to a pgeRect2 to be processed
x - x coordinate of the center
y - y coordinate of the center
r - radius of the rect's inner circle

int pgeMathRectTestPoint ( pgeRect2 rect,
float  x,
float  y 
)

Test if a point lies within a pgeRect2

Parameters:
rect - pointer to a pgeRect2 as Input
x - float x coordinate
y - float y coordinate
Returns:
int 1 if x,y is withing rect, else 0

float pgeMathRound ( float  x  ) 

Round to nearest value

Parameters:
x - Input

float pgeMathSin ( float  rad  ) 

Calculate sine

Parameters:
x - Input in radians

void pgeMathSincos ( float  r,
float *  s,
float *  c 
)

Calculate sine and cosine

Parameters:
r - Input in radians
s - Pointer to a float for sin result
c - pointer to a float for cos result

float pgeMathSinh ( float  x  ) 

Calculate hyperbolic sine

Parameters:
x - Input in radians

float pgeMathSqrt ( float  x  ) 

Calculate square root

Parameters:
x - Input

void pgeMathSrand ( unsigned int  x  ) 

Set random generator seed

Parameters:
x - Seed value

float pgeMathTan ( float  x  ) 

Calculate tangent

Parameters:
x - Input in radians

float pgeMathTanh ( float  x  ) 

Calculate hyperbolic tangent

Parameters:
x - Input in radians

float pgeMathTrunc ( float  x  ) 

Round towards 0

Parameters:
x - Input

ScePspFVector3* pgeMathVecAdd3f ( ScePspFVector3 *  result,
const ScePspFVector3 *  vec1,
const ScePspFVector3 *  vec2 
)

Add two ScePSPFVector3

Parameters:
result - pointer to an ScePSPFVector3 the result gets stored in
vec1 - pointer to an ScePSPFVector3 to be added
vec2 - pointer to an ScePSPFVector3 to be added
Returns:
a pointer to an ScePSPFVector3 as result

float pgeMathVecAngle3f ( const ScePspFVector3 *  vec1,
const ScePspFVector3 *  vec2 
)

Calculate the angle between two ScePSPFVector3

Parameters:
vec1 - pointer to an ScePSPFVector3 as Input
vec2 - pointer to an ScePSPFVector3 as Input
Returns:
float result of the dot product of vec1 and vec2

int pgeMathVecCompare3f ( const ScePspFVector3 *  vec1,
const ScePspFVector3 *  vec2 
)

Compare two ScePSPFVector3

Parameters:
vec1 - pointer to an ScePSPFVector3 for comparison
vec2 - pointer to an ScePSPFVector3 for comparison
Returns:
1 if vec1 == vec2, else 0

float pgeMathVecDot3f ( const ScePspFVector3 *  vec1,
const ScePspFVector3 *  vec2 
)

Calculate the dot product of two ScePSPFVector3

Parameters:
vec1 - pointer to an ScePSPFVector3 as Input
vec2 - pointer to an ScePSPFVector3 as Input
Returns:
float result of the dot product of vec1 and vec2

float pgeMathVecLength3f ( const ScePspFVector3 *  vec  ) 

Calculate the length of a ScePSPFVector3

Parameters:
vec - pointer to an ScePSPFVector3 as Input
Returns:
float result of the length calculation of vec

ScePspFVector3* pgeMathVecNormalize3f ( ScePspFVector3 *  result,
const ScePspFVector3 *  vec 
)

Normalize an ScePSPFVector3

Parameters:
result - pointer to an ScePSPFVector3 the result gets stored in
vec - pointer to an ScePSPFVector3 to be normalized
Returns:
a pointer to an ScePSPFVector3 as result

ScePspFVector3* pgeMathVecRotateZ3f ( const ScePspFVector3 *  vec,
float  a,
ScePspFVector3 *  result 
)

Rotate a ScePSPFVector3 about the Z-axis

Parameters:
vec - pointer to an ScePSPFVector3 as Input
a - float Input angle in radians
result - pointer to an ScePSPFVector3 the result gets stored in
Returns:
pointer to the ScePSPFVector3 result

ScePspFVector3* pgeMathVecScale3f ( ScePspFVector3 *  result,
const ScePspFVector3 *  vec,
float  scalar 
)

Scale a ScePSPFVector3 by a scalar

Parameters:
result - pointer to an ScePSPFVector3 the result gets stored in
vec - pointer to an ScePSPFVector3 for multiplication
scalar - float for multiplication
Returns:
a pointer to an ScePSPFVector3 as result

ScePspFVector3* pgeMathVecSub3f ( ScePspFVector3 *  result,
const ScePspFVector3 *  vec1,
const ScePspFVector3 *  vec2 
)

Subtract a ScePSPFVector3 from another ScePSPFVector3

Parameters:
result - pointer to an ScePSPFVector3 the result gets stored in
vec1 - pointer to an ScePSPFVector3 as minuend
vec2 - pointer to an ScePSPFVector3 as subtrahend
Returns:
a pointer to an ScePSPFVector3 as result


Generated on Mon Sep 22 16:58:14 2008 for Phoenix Game Engine by  doxygen 1.5.5