This commit is contained in:
Timur A. Fatkhullin 2025-04-29 18:31:41 +03:00
parent 18628aff28
commit e1421a1c2e
2 changed files with 13 additions and 5 deletions

View File

@ -417,15 +417,15 @@ std::pair<std::chrono::duration<double>, std::chrono::duration<double>> mcc_time
auto C1C3 = C1_2 + C3_2;
auto D = C2_2 * C3_2 - C1C3 * (C2_2 - C1_2);
if (D < 0.0) {
if (D < 0.0) { // object never reach given azimuth
return {inf_dur, inf_dur};
}
auto cos_t1 = -(C2C3 + sqrt(D)) / C1C3;
auto cos_t2 = -(C2C3 - sqrt(D)) / C1C3;
auto cos_ha1 = -(C2C3 + sqrt(D)) / C1C3;
auto cos_ha2 = -(C2C3 - sqrt(D)) / C1C3;
auto sin_z1 = (C2 + C3 * cos_t1) / cos_az;
auto sin_z2 = (C2 + C3 * cos_t2) / cos_az;
auto sin_z1 = (C2 + C3 * cos_ha1) / cos_az;
auto sin_z2 = (C2 + C3 * cos_ha2) / cos_az;
auto ut1 = now + dut1;
auto tt = now + tai_utc + tt_tai;

View File

@ -235,6 +235,14 @@ public:
bool inZone(const MccAngle& x, const MccAngle& y, const MccProhibitedZone::pzcontext_t& context)
{
if (context.coords_kind == MccProhibitedZone::COORDS_KIND_AZALT) { // trivial case
auto xx = x;
xx.normalize<MccAngle::NORM_KIND_180_180>(); // to [-180, 180]
if (std::fabs(xx) <= _deltaAZ) { // check at the South
return true;
} else if (std::fabs(xx - std::numbers::pi) <= _deltaAZ) { // check at the North
return true;
}
}
return false;