...
This commit is contained in:
parent
33002f1711
commit
06c8345fc9
@ -66,7 +66,7 @@ message(STATUS ${ERFA_INCLUDE_DIR})
|
|||||||
|
|
||||||
set(MCC_LIBRARY_SRC1 mcc_generics.h mcc_defaults.h mcc_traits.h mcc_utils.h
|
set(MCC_LIBRARY_SRC1 mcc_generics.h mcc_defaults.h mcc_traits.h mcc_utils.h
|
||||||
mcc_ccte_iers.h mcc_ccte_iers_default.h mcc_ccte_erfa.h mcc_telemetry.h
|
mcc_ccte_iers.h mcc_ccte_iers_default.h mcc_ccte_erfa.h mcc_telemetry.h
|
||||||
mcc_pzone.h mcc_pzone_container.h)
|
mcc_angle.h mcc_pzone.h mcc_pzone_container.h)
|
||||||
set(MCC_LIBRARY1 mcc1)
|
set(MCC_LIBRARY1 mcc1)
|
||||||
add_library(${MCC_LIBRARY1} INTERFACE ${MCC_LIBRARY_SRC1})
|
add_library(${MCC_LIBRARY1} INTERFACE ${MCC_LIBRARY_SRC1})
|
||||||
target_compile_features(${MCC_LIBRARY1} INTERFACE cxx_std_23)
|
target_compile_features(${MCC_LIBRARY1} INTERFACE cxx_std_23)
|
||||||
|
|||||||
@ -527,6 +527,10 @@ struct mcc_pzone_interface_t {
|
|||||||
return std::forward<SelfT>(self).timeFromPZone(std::move(coords), res_time);
|
return std::forward<SelfT>(self).timeFromPZone(std::move(coords), res_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// NOTE: the method must return:
|
||||||
|
// point = mcc_celestial_point_c{.pair_kind = MccCoordPairKind::COORDS_KIND_GENERIC, .X = NaN, .Y = NaN}
|
||||||
|
// if there is no intersection with the zone for given coordinates!
|
||||||
template <std::derived_from<mcc_pzone_interface_t> SelfT, typename InputT>
|
template <std::derived_from<mcc_pzone_interface_t> SelfT, typename InputT>
|
||||||
RetT intersectPZone(this SelfT&& self, InputT coords, mcc_celestial_point_c auto* point)
|
RetT intersectPZone(this SelfT&& self, InputT coords, mcc_celestial_point_c auto* point)
|
||||||
requires(mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>) &&
|
requires(mcc_eqt_hrz_coord_c<InputT> || mcc_celestial_point_c<InputT>) &&
|
||||||
|
|||||||
@ -288,7 +288,10 @@ public:
|
|||||||
auto cos_ha = (_sinAlim - sinDec * _sinLat) / cosDec / _cosLat;
|
auto cos_ha = (_sinAlim - sinDec * _sinLat) / cosDec / _cosLat;
|
||||||
|
|
||||||
if (cos_ha > 1.0) { // no intersection
|
if (cos_ha > 1.0) { // no intersection
|
||||||
// compute culmination points?
|
point->pair_kind = MccCoordPairKind::COORDS_KIND_GENERIC;
|
||||||
|
point->X = std::numeric_limits<double>::quiet_NaN();
|
||||||
|
point->Y = std::numeric_limits<double>::quiet_NaN();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -212,6 +212,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
return forEach(coords, apply_func, _inZoneFuncCPT, _inZoneFuncEHC);
|
return forEach(coords, apply_func, _inZoneFuncCPT, _inZoneFuncEHC);
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
#include "../mcc_ccte_erfa.h"
|
#include "../mcc_ccte_erfa.h"
|
||||||
#include "../mcc_pzone.h"
|
#include "../mcc_pzone.h"
|
||||||
@ -88,6 +89,16 @@ int main()
|
|||||||
|
|
||||||
// std::vector<std::chrono::duration<double, std::ratio<60>>> vm;
|
// std::vector<std::chrono::duration<double, std::ratio<60>>> vm;
|
||||||
std::vector<std::chrono::minutes> vm;
|
std::vector<std::chrono::minutes> vm;
|
||||||
|
std::list<bool> lb;
|
||||||
|
bool cf;
|
||||||
|
ret = pzcont.inPZone(eqhrz, &cf, &lb);
|
||||||
|
std::cout << "ret = " << ret.message() << "\n";
|
||||||
|
std::cout << std::boolalpha;
|
||||||
|
std::cout << "IN ZONE 1: " << lb.front() << "\n";
|
||||||
|
std::cout << "IN ZONE 2: " << lb.back() << "\n";
|
||||||
|
std::cout << "COMMON IN ZONE 1,2: " << cf << "\n";
|
||||||
|
|
||||||
|
|
||||||
ret = pzcont.timeToPZone(eqhrz, &vm);
|
ret = pzcont.timeToPZone(eqhrz, &vm);
|
||||||
std::cout << "ret = " << ret.message() << "\n";
|
std::cout << "ret = " << ret.message() << "\n";
|
||||||
std::cout << "TIME TO ZONE 1: " << vm[0] << "\n";
|
std::cout << "TIME TO ZONE 1: " << vm[0] << "\n";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user