65 lines
1.7 KiB
C++
65 lines
1.7 KiB
C++
#ifndef ANGLE_H
|
|
#define ANGLE_H
|
|
|
|
class Angle
|
|
{
|
|
public:
|
|
Angle();
|
|
Angle(char angle);
|
|
Angle(Angle const& angle);
|
|
|
|
static void loadAll(); // précalcule les cosinus
|
|
|
|
|
|
Angle& operator+=(const Angle& a);
|
|
Angle& operator+=(const char& a);
|
|
Angle& operator++();
|
|
Angle& operator-=(const Angle& a);
|
|
Angle& operator-=(const char& a);
|
|
Angle& operator--();
|
|
Angle& operator=(const char& a);
|
|
bool testEgalite(Angle const& angle) const;
|
|
bool testEgalite(char const& angle) const;
|
|
bool testSuperieur(Angle const& angle) const; // true si this > angle
|
|
bool testSuperieur(char const& angle) const;
|
|
|
|
|
|
|
|
double cos()const;
|
|
double sin()const;
|
|
double tan()const;
|
|
static double cos(char const angle);
|
|
static double sin(char const angle);
|
|
static double tan(char const angle);
|
|
static double cos(Angle const& angle);
|
|
static double sin(Angle const& angle);
|
|
static double tan(Angle const& angle);
|
|
protected:
|
|
char m_currentValue;
|
|
|
|
static bool hasBeenLoadedBefore;
|
|
static double m_cos[256],m_sin[256],m_tan[256];
|
|
|
|
|
|
};
|
|
|
|
bool operator==(Angle const& a, Angle const& b);
|
|
bool operator>=(Angle const& a, Angle const& b);
|
|
bool operator<=(Angle const& a, Angle const& b);
|
|
bool operator> (Angle const& a, Angle const& b);
|
|
bool operator< (Angle const& a, Angle const& b);
|
|
|
|
bool operator==(Angle const& a, char const& b);
|
|
bool operator>=(Angle const& a, char const& b);
|
|
bool operator<=(Angle const& a, char const& b);
|
|
bool operator> (Angle const& a, char const& b);
|
|
bool operator< (Angle const& a, char const& b);
|
|
|
|
|
|
|
|
Angle operator+(Angle const& a, Angle const& b);
|
|
Angle operator-(Angle const& a, Angle const& b);
|
|
|
|
Angle operator+(Angle const& a, char const& b);
|
|
Angle operator-(Angle const& a, char const& b);
|
|
#endif |