Aria
2.7.5.2
|
This class has static members to do common math operations. More...
#include <ariaUtil.h>
Static Public Member Functions | |
static double | addAngle (double ang1, double ang2) |
This adds two angles together and fixes the result to [-180, 180]. More... | |
static bool | angleBetween (double angle, double startAngle, double endAngle) |
Finds if one angle is between two other angles. | |
static double | atan2 (double y, double x) |
Finds the arctan of the given y/x pair. More... | |
static double | cos (double angle) |
Finds the cos, from angles in degrees. More... | |
static double | degToRad (double deg) |
Converts an angle in degrees to an angle in radians. More... | |
static double | distanceBetween (double x1, double y1, double x2, double y2) |
Finds the distance between two coordinates. More... | |
static double | epsilon () |
static double | fabs (double val) |
Finds the absolute value of a double. More... | |
static double | fixAngle (double angle) |
Takes an angle and returns the angle in range (-180,180]. More... | |
static long | getRandMax () |
Maximum of value returned by random() | |
static bool | isNan (double d) |
Platform-independent call to determine whether the given double is not-a-number. | |
static double | log2 (double x) |
static void | pointRotate (double *x, double *y, double th) |
Rotates a point around 0 by degrees given. | |
static double | radToDeg (double rad) |
Converts an angle in radians to an angle in degrees. More... | |
static long | random (void) |
static long | randomInRange (long m, long n) |
static int | roundInt (double val) |
Finds the closest integer to double given. More... | |
static short | roundShort (double val) |
Finds the closest short to double given. More... | |
static double | sin (double angle) |
Finds the sin, from angles in degrees. More... | |
static double | squaredDistanceBetween (double x1, double y1, double x2, double y2) |
Finds the squared distance between two coordinates. More... | |
static double | subAngle (double ang1, double ang2) |
This subtracts one angle from another and fixes the result to [-180,180]. More... | |
static double | tan (double angle) |
Finds the tan, from angles in degrees. More... | |
This class has static members to do common math operations.
|
inlinestatic |
|
inlinestatic |
Finds the arctan of the given y/x pair.
y | the y distance |
x | the x distance |
|
inlinestatic |
Finds the cos, from angles in degrees.
angle | angle to find the cos of, in degrees |
|
inlinestatic |
Converts an angle in degrees to an angle in radians.
deg | the angle in degrees |
|
inlinestatic |
Finds the distance between two coordinates.
x1 | the first coords x position |
y1 | the first coords y position |
x2 | the second coords x position |
y2 | the second coords y position |
|
static |
|
inlinestatic |
Finds the absolute value of a double.
val | the number to find the absolute value of |
|
inlinestatic |
|
inlinestatic |
Base-2 logarithm
|
inlinestatic |
Converts an angle in radians to an angle in degrees.
rad | the angle in radians |
|
inlinestatic |
Returns a random number between 0 and RAND_MAX on Windows, 2^31 on Linux (see ArUtil::getRandMax()). On Windows, rand() is used, on Linux, lrand48().
|
static |
Returns a random number between m and n. On Windows, rand() is used, on Linux lrand48().
|
inlinestatic |
Finds the closest integer to double given.
val | the double to find the nearest integer to |
|
inlinestatic |
Finds the closest short to double given.
val | the double to find the nearest short to |
|
inlinestatic |
Finds the sin, from angles in degrees.
angle | angle to find the sin of, in degrees |
|
inlinestatic |
Finds the squared distance between two coordinates.
use this only where speed really matters
x1 | the first coords x position |
y1 | the first coords y position |
x2 | the second coords x position |
y2 | the second coords y position |
|
inlinestatic |
|
inlinestatic |
Finds the tan, from angles in degrees.
angle | angle to find the tan of, in degrees |