CAMath Class Reference

Mathematical methods for generic use. More...

#include <camath.h>

List of all members.

Static Public Member Functions

static bool compFloat (float f1, float f2, float tol=0.001)
 Compares two float values.
static float corrAngle (float ang)
 Corrects an angle (to the range of 0-360).
static float getAngle (float x1, float y1, float x2, float y2)
 Returns the angle (in degrees) from one point to an other.
static float getDistance (float x1, float y1, float x2, float y2)
 Returns the distance from one point to an other.
static float getAngleDiff (float a1, float a2)
 Get Angle difference between _a1 and _a2 (Which angle must I add to _a1 to get _a2) All angles in degrees.
static bool getIntersection (int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2, int *ix, int *iy)
 Calculates the intersection point of two lines.
static int getRandomNumber (int min, int max)
 Gets a random number from 'min' to 'max'.
static void timeToString (char *string, int time)
 Converts a time in millisecs to a string in the format <minutes>:<seconds>.


Detailed Description

Mathematical methods for generic use.

Author:
Andrew Mustun


Member Function Documentation

bool CAMath::compFloat ( float  f1,
float  f2,
float  tol = 0.001 
) [static]

Compares two float values.

Returns:
true if the two values differ less than the tolerance value.

float CAMath::corrAngle ( float  ang  )  [static]

Corrects an angle (to the range of 0-360).

Returns:
The corrected angle

void CAMath::timeToString ( char *  string,
int  time 
) [static]

Converts a time in millisecs to a string in the format <minutes>:<seconds>.

<hundredth>. (e.g. "5:02.23") 'string' must have at least place for 9 characters.


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 06:48:28 2006 by  doxygen 1.5.0