Math (EM4)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

Information: The EMERGENCY community board is completely free and is financed by advertisement. Please deactivate adblocker if you use this site. Thank you!

  • Namespace / class 'Math'

    Table Of Contents

    Defined functions

    Source Code

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

    992 times viewed