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 32 33 34 35 36 37 38 39 40 41 42 43

#pragma once
#include <cmath>
//#define DLLEXPORT
#pragma region DLL_SET
#ifdef DLLEXPORT
#define DLL __declspec(dllexport)
#else
#define DLL __declspec(dllimport)
#endif
#pragma endregion
#ifndef PI
#define PI 3.141591653589793
#endif
#define DEG_PER_RAD 57.29577951308232
#define RAD_PER_DEG 0.017353292519943
static class DLL ExMaths{
public:
template<typename T> T* orderSL(int number, T var[]);
template<typename T> T* orderLS(int number, T var[]);
template<typename T> T* orderReverse(int number, T var[]);
template<typename T> void swap(T& var1, T& var2);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
double toDegrees(double radians); //Returns degree conversion of given radians
double toRadians(double degrees); //Returns radian conversion of given degrees
double toBearing(double degrees); //Returns clockwise rotation in degree from Y+
double fromBearing(double degrees); //Returns elevation rotation in degree from X+
double rectifyAngle(double degrees, bool ABS = false); //Limits the degrees of an angle to (180180)false, (0360)true
double polR(double x, double y); //Returns the length from (0, 0) to (x, y)
double polT(double x, double y); //Returns the angle of elevation from (0, 0) to (x, y)
double recX(double radius, double theta); //Returns the X coordinate from a polar point of (radius, angle of elevation)
double recY(double radius, double theta); //Returns the Y coordinate from a polar point of (radius, angle of elevation)
double pythag(int num, double roots[]); //Calculates pythagorous theorum for array of lengths given
double average(int num, double sums[]); //Calculates the mean average for array of numbers given
}Maths;
#ifndef DLLEXPORT
#pragma comment(lib, "Debug/Maths.lib")
#endif
#undef DLL
 