-
Notifications
You must be signed in to change notification settings - Fork 1
/
angles.h
28 lines (24 loc) · 1.26 KB
/
angles.h
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
/*#-------------------------------------------------
#
# Angles utilities
#
# by AbsurdePhoton - www.absurdephoton.fr
#
# v1.1 - 2020/02/06
#
#-------------------------------------------------*/
#ifndef ANGLES_H
#define ANGLES_H
class Angle { // angles formulas in radians and degrees
public:
static long double RadToDeg(const long double &rad); // convert radians value to degrees
static long double DegToRad(const long double °); // convert degrees value to radians
static long double NormalizedToRad(const long double &normalized); // convert normalized radians to 2Pi rad
static long double NormalizedToDeg(const long double &normalized); // convert normalized degrees to 360°
static long double RadToNormalized(const long double &rad); // convert radians to [0..1]
static long double DegToNormalized(const long double °); // convert degrees to [0..1]
static long double DifferenceRad(const long double &a1, const long double &a2); // distance between 2 angles in radians
static long double DifferenceDeg(const long double &a1, const long double &a2); // distance between 2 angles in degrees
};
const long double Pi = 3.14159265358979323846264338328L;
#endif // ANGLES_H