...
This commit is contained in:
parent
18628aff28
commit
e1421a1c2e
@ -417,15 +417,15 @@ std::pair<std::chrono::duration<double>, std::chrono::duration<double>> mcc_time
|
|||||||
|
|
||||||
auto C1C3 = C1_2 + C3_2;
|
auto C1C3 = C1_2 + C3_2;
|
||||||
auto D = C2_2 * C3_2 - C1C3 * (C2_2 - C1_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};
|
return {inf_dur, inf_dur};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto cos_t1 = -(C2C3 + sqrt(D)) / C1C3;
|
auto cos_ha1 = -(C2C3 + sqrt(D)) / C1C3;
|
||||||
auto cos_t2 = -(C2C3 - sqrt(D)) / C1C3;
|
auto cos_ha2 = -(C2C3 - sqrt(D)) / C1C3;
|
||||||
|
|
||||||
auto sin_z1 = (C2 + C3 * cos_t1) / cos_az;
|
auto sin_z1 = (C2 + C3 * cos_ha1) / cos_az;
|
||||||
auto sin_z2 = (C2 + C3 * cos_t2) / cos_az;
|
auto sin_z2 = (C2 + C3 * cos_ha2) / cos_az;
|
||||||
|
|
||||||
auto ut1 = now + dut1;
|
auto ut1 = now + dut1;
|
||||||
auto tt = now + tai_utc + tt_tai;
|
auto tt = now + tai_utc + tt_tai;
|
||||||
|
|||||||
@ -235,6 +235,14 @@ public:
|
|||||||
bool inZone(const MccAngle& x, const MccAngle& y, const MccProhibitedZone::pzcontext_t& context)
|
bool inZone(const MccAngle& x, const MccAngle& y, const MccProhibitedZone::pzcontext_t& context)
|
||||||
{
|
{
|
||||||
if (context.coords_kind == MccProhibitedZone::COORDS_KIND_AZALT) { // trivial case
|
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;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user