Go to the documentation of this file.
9 #ifndef EAGINE_QUANTITIES_HPP
10 #define EAGINE_QUANTITIES_HPP
19 EAGINE_DIAG_OFF(
double-promotion)
82 static constexpr
auto turns_(T value) noexcept {
95 typename = std::enable_if_t<is_convertible_quantity_v<Qty, units::radian>>>
96 static constexpr
auto sin(
const Qty&
qty) {
98 return sin(value(convert_to<units::radian>(
qty)));
110 typename = std::enable_if_t<is_convertible_quantity_v<Qty, units::radian>>>
111 static constexpr
auto cos(
const Qty&
qty) {
113 return cos(value(convert_to<units::radian>(
qty)));
125 typename = std::enable_if_t<is_convertible_quantity_v<Qty, units::radian>>>
126 static constexpr
auto tan(
const Qty&
qty) {
128 return tan(value(convert_to<units::radian>(
qty)));
138 template <
typename T>
141 return make_tagged_quantity<units::radian>(asin(x));
151 template <
typename T>
154 return make_tagged_quantity<units::radian>(acos(x));
164 template <
typename T>
167 return make_tagged_quantity<units::radian>(atan2(y, x));
173 template <
typename T>
182 template <
typename T>
190 template <
typename T>
195 template <
typename T>
206 #endif // EAGINE_QUANTITIES_HPP
static constexpr auto sin(const Qty &qty)
Overload of sine for quantities of angle.
Definition: quantities.hpp:96
Common code is placed in this namespace.
Definition: eagine.hpp:21
static constexpr auto kelvins_(T value) noexcept -> kelvins_t< T >
Creates a tagged quantity storing value in kelvins.
Definition: quantities.hpp:196
static constexpr auto arctan(T y, T x)
Overload of tangens for quantities of angle.
Definition: quantities.hpp:165
static constexpr auto tan(const Qty &qty)
Overload of tangens for quantities of angle.
Definition: quantities.hpp:126
static constexpr const auto pi
The pi constant.
Definition: constants.hpp:23
static constexpr auto seconds_(T value) noexcept -> seconds_t< T >
Creates a tagged quantity storing value in seconds.
Definition: quantities.hpp:33
static constexpr auto radians_(T value) noexcept -> radians_t< T >
Creates a tagged quantity storing value in radians.
Definition: quantities.hpp:50
static constexpr auto turns_(T value) noexcept
Creates a tagged quantity in full turn units.
Definition: quantities.hpp:82
static constexpr auto arccos(T x)
Overload of arc cosine for quantities of angle.
Definition: quantities.hpp:152
static constexpr auto right_angles_(T value) noexcept
Creates a tagged quantity in units of right angle.
Definition: quantities.hpp:61
static constexpr auto degrees_(T value) noexcept -> degrees_t< T >
Creates a tagged quantity storing value in degrees.
Definition: quantities.hpp:183
static constexpr auto arcsin(T x)
Overload of arc sine for quantities of angle.
Definition: quantities.hpp:139
static constexpr auto cos(const Qty &qty)
Overload of cosine for quantities of angle.
Definition: quantities.hpp:111
Value of type T with a specified unit or tag type U.
Definition: tagged_quantity.hpp:27
static constexpr auto right_angle_() noexcept
Creates a tagged quantity a right angle value.
Definition: quantities.hpp:71