Skip to content

Commit c708281

Browse files
committed
hours to radians
1 parent 3d123fc commit c708281

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/units.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ inline constexpr double hsec2rad(double seconds) noexcept {
6161
return seconds * f;
6262
}
6363

64+
/** @brief Convert hours (of time) to radians.
65+
* @param[in] hours Angle in [hours] of time
66+
* @return The (input) angle in [rad]
67+
*/
68+
inline constexpr double hours2rad(double hours) noexcept {
69+
constexpr const double f = detail::AngleUnitTraits<
70+
detail::AngleUnit::Hours>::to_units<detail::AngleUnit::Radians>();
71+
return hours * f;
72+
}
73+
6474
/** Normalize angle in the range [0, 2π]/[0,360]
6575
*
6676
* @tparam U Units of input angle, AngleUnits::Radians, or AngleUnits::Degrees

0 commit comments

Comments
 (0)