13template<
typename TimeType,
typename UnitType>
14inline auto duration_to_HMS(
const std::chrono::duration<TimeType, UnitType>& totalTime)
15-> std::array<TimeType, 3>
17 auto hours = std::chrono::duration_cast<std::chrono::hours>(totalTime);
18 auto minutes = std::chrono::duration_cast<std::chrono::minutes>(totalTime - hours);
19 auto seconds = std::chrono::duration_cast<std::chrono::seconds>(totalTime - hours - minutes);
22 static_cast<TimeType
>(hours.count()),
23 static_cast<TimeType
>(minutes.count()),
24 static_cast<TimeType
>(seconds.count())};
27template<
typename TimeType>
29-> std::array<TimeType, 3>
31 return duration_to_HMS(std::chrono::duration<TimeType, std::milli>(totalTime));
34template<
typename TimeType>
36-> std::array<TimeType, 3>
54 const T standardTime24H,
55 const T standardMeridianRadians,
56 const T siteLongitudeRadians,
61 const T term1 =
static_cast<T
>(0.170) * std::sin(four_pi<T> * (julianDate -
static_cast<T
>(80)) /
static_cast<T
>(373));
62 const T term2 =
static_cast<T
>(-0.129) * std::sin(two_pi<T> * (julianDate -
static_cast<T
>(8)) /
static_cast<T
>(355));
63 const T term3 =
static_cast<T
>(12) * (standardMeridianRadians - siteLongitudeRadians) * rcp_pi<T>;
65 return standardTime24H + term1 + term2 + term3;
Math functions and utilities.
Definition TransformInfo.h:10
auto seconds_to_HMS(const TimeType &totalSeconds) -> std::array< TimeType, 3 >
Definition time.h:35
T mean_solar_time_to_solar_time_24H(const T standardTime24H, const T standardMeridianRadians, const T siteLongitudeRadians, const T julianDate)
Convert mean solar time to solar time.
Definition time.h:53
auto duration_to_HMS(const std::chrono::duration< TimeType, UnitType > &totalTime) -> std::array< TimeType, 3 >
Definition time.h:14
auto milliseconds_to_HMS(const TimeType &totalTime) -> std::array< TimeType, 3 >
Definition time.h:28