19 { T::radians_per_rep } -> std::convertible_to<double>;
20 { T::unit_label } -> std::convertible_to<std::string_view>;
24 template<std::
floating_po
int Rep, AngularUnitTraits Units>
32 template<std::convertible_to<Rep> Rep2>
38 template<AngularUnitTraits Units2>
44 template<std::convertible_to<Rep> Rep2, AngularUnitTraits Units2>
50 constexpr Rep
count()
const {
return value_; }
71 template<std::convertible_to<Rep> Rep2>
76 template<std::convertible_to<Rep> Rep2>
83 template<std::convertible_to<Rep> Rep2>
94 std::floating_point
Rep1,
96 std::floating_point
Rep2,
109 std::floating_point
Rep1,
111 std::floating_point
Rep2,
124 std::floating_point
Rep1,
126 std::floating_point
Rep2,
137 std::floating_point
Rep1,
139 std::floating_point
Rep2,
149 template<std::
floating_po
int Rep, AngularUnitTraits Units>
152 return o <<
angle.
count() <<
' ' << Units::unit_label;
157 template<std::
floating_po
int Rep, AngularUnitTraits Units>
167 std::floating_point Rep1,
169 std::floating_point Rep2,
172struct std::common_type<
osc::Angle<Rep1, Units1>,
osc::Angle<Rep2, Units2>> {
174 using units =
typename std::conditional_t<(Units1::radians_per_rep > Units2::radians_per_rep), Units1, Units2>;
222 static inline constexpr std::string_view
unit_label =
"turn";
246 std::floating_point
Rep1,
248 std::floating_point
Rep2,
253 using CA = std::common_type_t<
decltype(x),
decltype(y)>;
254 return CA{std::fmod(
CA{x}.count(),
CA{y}.count())};
261 std::floating_point
Rep1,
263 std::floating_point
Rep2,
266 requires (not std::is_same_v<Units1, Units2>)
269 using CA = std::common_type_t<
decltype(x),
decltype(y)>;
277 std::floating_point
Rep1,
279 std::floating_point
Rep2,
282 requires (not std::is_same_v<Units1, Units2>)
285 using CA = std::common_type_t<
decltype(x),
decltype(y)>;
293 std::floating_point Rep,
294 AngularUnitTraits
Units,
295 std::convertible_to<Angle<Rep, Units>>
AngleMin,
296 std::convertible_to<Angle<Rep, Units>>
AngleMax
299 not std::is_same_v<Angle<Rep, Units>,
AngleMin>
or
300 not std::is_same_v<Angle<Rep, Units>,
AngleMax>
or
301 not std::is_same_v<AngleMin, AngleMax>
constexpr friend Angle operator*(const Angle &lhs, const Rep2 &scalar)
Definition angle.h:77
constexpr friend Angle & operator+=(Angle &lhs, const Angle &rhs)
Definition angle.h:58
constexpr Angle(const Angle< Rep2, Units2 > &other)
Definition angle.h:45
constexpr Angle()=default
Rep value_type
Definition angle.h:27
constexpr friend Angle & operator-=(Angle &lhs, const Angle &rhs)
Definition angle.h:64
constexpr Angle operator-() const
Definition angle.h:54
constexpr friend Angle operator/(const Angle &lhs, const Rep2 &scalar)
Definition angle.h:84
constexpr Angle(const Rep2 &value_)
Definition angle.h:33
constexpr Rep count() const
Definition angle.h:50
constexpr friend Angle operator*(const Rep2 &scalar, const Angle &rhs)
Definition angle.h:72
constexpr Angle operator+() const
Definition angle.h:52
constexpr friend auto operator<=>(const Angle &, const Angle &)=default
constexpr Angle(const Angle< Rep, Units2 > &other)
Definition angle.h:39
Definition custom_decoration_generator.h:5
std::ostream & operator<<(std::ostream &, const Object &)
constexpr auto min(Angle< Rep1, Units1 > x, Angle< Rep2, Units2 > y) -> std::common_type_t< decltype(x), decltype(y)>
Definition angle.h:267
constexpr Angle< Rep, Units > clamp(const Angle< Rep, Units > &v, const AngleMin &min, const AngleMax &max)
Definition angle.h:303
bool operator==(const Class &, const Class &)
constexpr auto max(Angle< Rep1, Units1 > x, Angle< Rep2, Units2 > y) -> std::common_type_t< decltype(x), decltype(y)>
Definition angle.h:283
constexpr std::common_type_t< Angle< Rep1, Units1 >, Angle< Rep2, Units2 > > operator+(const Angle< Rep1, Units1 > &lhs, const Angle< Rep2, Units2 > &rhs)
Definition angle.h:99
auto mod(Angle< Rep1, Units1 > x, Angle< Rep2, Units2 > y) -> std::common_type_t< decltype(x), decltype(y)>
Definition angle.h:251
constexpr U to(T &&value)
Definition conversion.h:56
constexpr auto operator<=>(const Angle< Rep1, Units1 > &lhs, const Angle< Rep2, Units2 > &rhs)
Definition angle.h:142
constexpr std::common_type_t< Angle< Rep1, Units1 >, Angle< Rep2, Units2 > > operator-(const Angle< Rep1, Units1 > &lhs, const Angle< Rep2, Units2 > &rhs)
Definition angle.h:114
static constexpr std::string_view unit_label
Definition angle.h:204
static constexpr double radians_per_rep
Definition angle.h:203
static constexpr bool value
Definition scalar.h:12
static constexpr std::string_view unit_label
Definition angle.h:186
static constexpr double radians_per_rep
Definition angle.h:185
static constexpr std::string_view unit_label
Definition angle.h:222
static constexpr double radians_per_rep
Definition angle.h:221
typename std::conditional_t<(Units1::radians_per_rep > Units2::radians_per_rep), Units1, Units2 > units
Definition angle.h:174