...
This commit is contained in:
@@ -271,7 +271,7 @@ public:
|
||||
// binary arithmetic operations
|
||||
|
||||
template <std::convertible_to<MccAngle> T1, std::convertible_to<MccAngle> T2>
|
||||
auto operator+(const T1& v1, const T2& v2)
|
||||
static auto operator+(const T1& v1, const T2& v2)
|
||||
{
|
||||
static_assert(std::convertible_to<T1, T2> || std::convertible_to<T2, T1>, "INCOMPATIBLE TYPES!");
|
||||
|
||||
@@ -281,7 +281,7 @@ auto operator+(const T1& v1, const T2& v2)
|
||||
}
|
||||
|
||||
template <std::convertible_to<MccAngle> T1, std::convertible_to<MccAngle> T2>
|
||||
auto operator-(const T1& v1, const T2& v2)
|
||||
static auto operator-(const T1& v1, const T2& v2)
|
||||
{
|
||||
static_assert(std::convertible_to<T1, T2> || std::convertible_to<T2, T1>, "INCOMPATIBLE TYPES!");
|
||||
|
||||
@@ -292,7 +292,7 @@ auto operator-(const T1& v1, const T2& v2)
|
||||
|
||||
|
||||
template <std::convertible_to<MccAngle> T1, std::convertible_to<MccAngle> T2>
|
||||
auto operator*(const T1& v1, const T2& v2)
|
||||
static auto operator*(const T1& v1, const T2& v2)
|
||||
{
|
||||
if constexpr (std::is_arithmetic_v<T1>) {
|
||||
return v2 *= v1;
|
||||
@@ -304,7 +304,7 @@ auto operator*(const T1& v1, const T2& v2)
|
||||
}
|
||||
|
||||
template <std::convertible_to<MccAngle> T1, typename T2>
|
||||
auto operator/(const T1& v1, const T2& v2)
|
||||
static auto operator/(const T1& v1, const T2& v2)
|
||||
requires std::is_arithmetic_v<T2>
|
||||
{
|
||||
return v1 /= v2;
|
||||
@@ -343,34 +343,19 @@ class MccAngleAZ : public MccAngle
|
||||
using MccAngle::MccAngle;
|
||||
};
|
||||
|
||||
class MccAngleALT; // just forward declaration
|
||||
|
||||
class MccAngleZD : public MccAngle
|
||||
{
|
||||
public:
|
||||
using MccAngle::MccAngle;
|
||||
|
||||
MccAngleZD(const MccAngleALT&);
|
||||
};
|
||||
|
||||
class MccAngleALT : public MccAngle
|
||||
{
|
||||
public:
|
||||
using MccAngle::MccAngle;
|
||||
|
||||
MccAngleALT(const MccAngleZD& zd)
|
||||
{
|
||||
_angleInRads = std::numbers::pi / 2.0 - (double)zd;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
MccAngleZD::MccAngleZD(const MccAngleALT& alt)
|
||||
{
|
||||
_angleInRads = std::numbers::pi / 2.0 - (double)alt;
|
||||
}
|
||||
|
||||
|
||||
class MccAngleX : public MccAngle // some co-longitude coordinate
|
||||
{
|
||||
using MccAngle::MccAngle;
|
||||
|
||||
Reference in New Issue
Block a user