diff --git a/libs/main/math/pimathbase.h b/libs/main/math/pimathbase.h index 553437f5..d270c619 100644 --- a/libs/main/math/pimathbase.h +++ b/libs/main/math/pimathbase.h @@ -109,8 +109,12 @@ PIP_EXPORT double piYn(int n, const double & v); template inline constexpr T toDb(T val) {return T(10.) * std::log10(val);} template inline constexpr T fromDb(T val) {return std::pow(T(10.), val / T(10.));} -template inline constexpr T toRad(T deg) {return deg * T(M_PI_180);} -template inline constexpr T toDeg(T rad) {return rad * T(M_180_PI);} +inline constexpr float toRad(float deg) {return deg * M_PI_180;} +inline constexpr double toRad(double deg) {return deg * M_PI_180;} +inline constexpr long double toRad(long double deg) {return deg * M_PI_180;} +inline constexpr float toDeg(float rad) {return rad * M_180_PI;} +inline constexpr double toDeg(double rad) {return rad * M_180_PI;} +inline constexpr long double toDeg(long double rad) {return rad * M_180_PI;} template inline constexpr T sqr(const T & v) {return v * v;} // [-1 ; 1] diff --git a/libs/main/math/pimathvector.h b/libs/main/math/pimathvector.h index 547b03bb..a98cef49 100644 --- a/libs/main/math/pimathvector.h +++ b/libs/main/math/pimathvector.h @@ -85,7 +85,7 @@ public: return std::sqrt(Type(1) - tv * tv); } Type angleRad(const _CVector & v) const {return std::acos(angleCos(v));} - Type angleDeg(const _CVector & v) const {return toDeg(angleRad(v));} + Type angleDeg(const _CVector & v) const {return toDeg(angleRad(v));} Type angleElevation(const _CVector & v) const {return 90.0 - angleDeg(v - *this);} _CVector projection(const _CVector & v) { Type tv = v.length();