11static constexpr auto M_RADIANS_TO_DEGREES = 180.0 / M_PI;
15 using StrictType::StrictType;
16 explicit constexpr Degrees(
const DirectionSize degrees) noexcept
17 :
Degrees{
static_cast<MathSize
>(degrees)}
22 using StrictType::StrictType;
30 :
Radians{degrees.value / M_RADIANS_TO_DEGREES}
33 [[nodiscard]]
constexpr Degrees asDegrees()
const
35 return Degrees{value * M_RADIANS_TO_DEGREES};
39 auto v = radians.value;
40 while (v > PiX2().value)
44 while (v < Radians::Zero().value)
62 [[nodiscard]]
static constexpr Radians from_degrees(
const MathSize degrees)
66 [[nodiscard]]
static constexpr Radians from_aspect(
const MathSize aspect)
68 return Radians{
static_cast<AspectSize
>(aspect)};
71static constexpr Degrees INVALID_DIRECTION{std::numeric_limits<DirectionSize>::max()};
72static constexpr Radians abs(
const Radians& radians) {
return Radians{radians.value}; };
73static inline MathSize tan(
const Radians& radians) {
return std::tan(radians.value); };
74static inline MathSize sin(
const Radians& radians) {
return fs::sin(radians.value); };
75static inline MathSize cos(
const Radians& radians) {
return fs::cos(radians.value); };
76static constexpr Degrees abs(
const Degrees& degrees) {
return Degrees{degrees.value}; };
77static inline MathSize tan(
const Degrees& degrees) {
return tan(Radians{degrees}); };
78static inline MathSize sin(
const Degrees& degrees) {
return sin(Radians{degrees}); };
79static inline MathSize cos(
const Degrees& degrees) {
return cos(Radians{degrees}); };
constexpr Radians fix() const
Ensure that value lies between 0 and 2 * PI.
Definition Radians.h:55
constexpr Radians to_heading() const
Convert Bearing to Heading (opposite angle)
Definition Radians.h:61
A wrapper around a ValueType to ensure correct types are used.
Definition StrictType.h:34