1 Defined functions
Code
namespace Math
{
extern const int RANDMAX;
float sqrt(float f); //Returns the square route of a number
int sqrti(int i); //Returns the square route of a number
float sqr(float f); //??? even square route
float VectorLen(float x, float y, float z); //Returns the length of a vector, outdate, use: float Vector::GetLen();
void NormalizeVector(float &x, float &y, float &z); //normalizes vector (lenght= 1). Oudated, use: Vector Vector::GetNormal();
int rand(); //Returns random number 0-1
int abs(int i); //Returns absolute value
float acos(float f); //arccos
float asin(float f); //arcsin
float atan(float f); //arctan
float atan2(float f, float g); //arctan2
float cos(float f); //cos
float cosh(float f); //cosh
float exp(float f); //exponent to base e: e^f
float fabs(float f); //Returns absolute value
float fmod(float f, float g); //???
float log(float f); //natural logarithm to base e
float log10(float f); //logarithm to base 10
float pow(float f, float g); //f^g
float sin(float f); //sin
float sinh(float f); //sinh
float tan(float f); //tan
float tanh(float f); //tanh
float atof(const char *s); //Char of Float
int atoi(const char *s); //Char of Integer
float ceil(float f); //returns the smallest integer, which is not lower than f (f = 4.8 -> 5)
float floor(float f); //returns the highest integer, which is not highter than f (f = 4.8 -> 4)
float dist2(float x0, float y0, float x1, float y1); //distance between two 2D vectors
float dist(float x0, float y0, float x1, float y1); //same as dist2()
float dist2(float x0, float y0, float z0, float x1, float y1, float z1); //distance between two 3D vectors, outdated, use: GetLen(vecA - vecB);
float dist(float x0, float y0, float z0, float x1, float y1, float z1); //same as dist2()
void RotateVector(float &vectorx_, float &vectory_, float &vectorz_, const float *matrix3x3_); //rotates the vector with the rotation matrix
void CrossProduct(float x, float y, float z, float &cx, float &cy, float &cz); //cross product between two vectors (vecA x vecB)
void EulerToMatrix(float yaw, float pitch, float roll, float *matrix3x3_); //three rotation vectors (r/p/y) to rotation matrix
void MultiplyMatrices(float *mat1_, const float *mat2_); //multiplizes two matrices
};
Display More