RoboidControl-cpp/AngleUsing.h
2024-07-31 11:44:23 +02:00

52 lines
1.0 KiB
C++

/*
#ifndef DISCRETEANGLE_H
#define DISCRETEANGLE_H
#include "Angle.h"
#include "Range.h"
namespace Passer {
namespace LinearAlgebra {
// A fixed angle between (-180..180]
template <typename T>
class AngleUsing {
public:
AngleUsing(T sourceValue) { this->value = sourceValue; }
AngleUsing(float f);
float ToFloat() const;
inline T GetValue() const { return this->value; }
AngleUsing<T> operator+(const AngleUsing<T> a) {
AngleUsing<T> r = AngleUsing((float)this->value + a.value);
return r;
}
inline AngleUsing<T> operator+=(const AngleUsing<T> a) {
return this->value + a.value;
}
inline AngleUsing<T> operator-(const AngleUsing<T> a) {
return this->value - a.value;
}
inline AngleUsing<T> operator-() {
this->value = -this->value;
return *this;
}
inline bool operator==(const AngleUsing<T> a) {
return this->value == a.value;
}
// protected:
T value;
};
} // namespace LinearAlgebra
} // namespace Passer
using namespace Passer::LinearAlgebra;
#endif
*/