1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
namespace SB{
namespace Maths{
template<typename T> T* orderSL(int number, T var[]) //Orders array small to large
template<typename T> T* orderLS(int number, T var[]) //Orders array large to small
template<typename T> T* orderReverse(int number, T var[]) //Reverse order of an array
template<typename T> void swar(T* var1, T* var2) //Swaps values of two identical types
//Most of these are self explanatory
double toDegrees(double radians);
double toRadians(double degrees);
double toBearing(double degrees);
double fromBearing(double degrees);
double rectifyAngle(double degrees, bool ABS = false); //limits an angle to (-PI & PI) or if ABS is true (0 & 2PI)
//rotates point about (0, 0, [0]), by radians
void rotatePoint(double* point[2], double radians);
void rotatePoint(double* point[3], double radians[3]);
//These are functions found on the Casio FX-83 GT... XD
double polR(double x, double y); //Finds radius of (x, y) from (0, 0)
double polT(double x, double y); //Finds angle of (x, y) from (0, 0)
double recX(double radius, double theta); //Finds x length of [r, t]
double recY(double radius, double theta); //Finds y length of [r, t]
//No explanation of top 2 needed hopefully
double pythag(int num, double roots[]);
double average(int num, double sums[]);
bool pRange(double exp, double tru, double range, bool ABS = false); //Tests if exp is within %<range> of tru, if ABS will only return for positive comparison
bool vRange(double exp, double tru, double range, bool ABS = false); //Same as above but uses a +/- comparison rather than % range
}
}
|