This commit is contained in:
Timur A. Fatkhullin 2025-04-28 18:31:13 +03:00
parent f0378a063f
commit fd105277b9
2 changed files with 51 additions and 0 deletions

View File

@ -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

View File

@ -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<std::common_type_t<decltype(v1), decltype(v2)>>::epsilon();
return std::fabs(v1 - v2) <= eps * std::fmax(std::fabs(v1), std::fabs(v2));
}
} // namespace mcc::utils