diff --git a/cxx/mount_pz.h b/cxx/mount_pz.h index a176666..0513067 100644 --- a/cxx/mount_pz.h +++ b/cxx/mount_pz.h @@ -214,6 +214,50 @@ private: }; +class MccNearMeridianPZ +{ +public: + MccNearMeridianPZ(const MccAngle& delta_az) : _deltaAZ(delta_az) + { + _deltaAZ.normalize(); // to [0, 360) + } + + std::string_view name() const + { + return "NEAR-MERIDIAN-LIMIT"; + } + + std::string_view desc() const + { + return "Near-meridian prohibited zone"; + } + + bool inZone(const MccAngle& x, const MccAngle& y, const MccProhibitedZone::pzcontext_t& context) + { + if (context.coords_kind == MccProhibitedZone::COORDS_KIND_AZALT) { // trivial case + } + + return false; + } + + auto timeTo(const MccAngle& x, + const MccAngle& y, + const MccProhibitedZone::pzcontext_t& context, + traits::mcc_systime_c auto const& utc = std::chrono::system_clock::now()) + { + } + + auto timeFrom(const MccAngle& x, + const MccAngle& y, + const MccProhibitedZone::pzcontext_t& context, + traits::mcc_systime_c auto const& utc = std::chrono::system_clock::now()) + { + } + +private: + MccAngle _deltaAZ; +}; + /* * a general planar ellipse equation: * A*(x-xc)^2 + B*(x-xc)(y-yc) + C*(y-yc)^2 = 1 diff --git a/cxx/utils.h b/cxx/utils.h index 7ca2839..d97131e 100644 --- a/cxx/utils.h +++ b/cxx/utils.h @@ -285,4 +285,11 @@ static std::string AZZD_rad2sxg(double az, double zd, std::string_view delim = " } +static bool isEqual(std::floating_point auto const& v1, std::floating_point auto const& v2) +{ + constexpr auto eps = std::numeric_limits>::epsilon(); + + return std::fabs(v1 - v2) <= eps * std::fmax(std::fabs(v1), std::fabs(v2)); +} + } // namespace mcc::utils