90 template<class AngleUnit,
std::enable_if_t<
traits::is_angle_unit_v<AngleUnit>,
int> = 0>
91 dimensionless<detail::floating_point_promotion_t<typename AngleUnit::underlying_type>>
cos(const AngleUnit
angle) noexcept
93 return std::cos(
convert<radians<detail::floating_point_promotion_t<typename AngleUnit::underlying_type>>>(
angle).value());
104 template<
class AngleUnit, std::enable_if_t<traits::is_angle_unit_v<AngleUnit>,
int> = 0>
105 dimensionless<detail::floating_point_promotion_t<typename AngleUnit::underlying_type>>
sin(
const AngleUnit
angle)
noexcept
107 return std::sin(
convert<radians<detail::floating_point_promotion_t<typename AngleUnit::underlying_type>>>(
angle).value());
117 template<
class AngleUnit, std::enable_if_t<traits::is_angle_unit_v<AngleUnit>,
int> = 0>
118 dimensionless<detail::floating_point_promotion_t<typename AngleUnit::underlying_type>>
tan(
const AngleUnit
angle)
noexcept
120 return std::tan(
convert<radians<detail::floating_point_promotion_t<typename AngleUnit::underlying_type>>>(
angle).value());
130 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
131 radians<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
acos(
const dimensionlessUnit x)
noexcept
133 return radians<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>(
134 std::acos(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>()));
144 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
145 radians<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
asin(
const dimensionlessUnit x)
noexcept
147 return radians<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>(
148 std::asin(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>()));
162 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
163 radians<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
atan(
const dimensionlessUnit x)
noexcept
165 return radians<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>(
166 std::atan(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>()));
178 template<class Y, class X, std::enable_if_t<traits::is_dimensionless_unit_v<decltype(std::declval<Y>() / std::declval<X>())>,
int> = 0>
179 radians<detail::floating_point_promotion_t<std::common_type_t<typename X::underlying_type, typename Y::underlying_type>>>
atan2(
180 const Y y,
const X x)
noexcept
182 using CommonUnit = std::common_type_t<X, Y>;
184 return radians<detail::floating_point_promotion_t<typename CommonUnit::underlying_type>>(std::atan2(CommonUnit(y).value(), CommonUnit(x).value()));
201 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
202 dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
cosh(
const dimensionlessUnit x)
noexcept
204 return std::cosh(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>());
217 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
218 dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
sinh(
const dimensionlessUnit x)
noexcept
220 return std::sinh(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>());
233 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
234 dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
tanh(
const dimensionlessUnit x)
noexcept
236 return std::tanh(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>());
248 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
249 dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
acosh(
const dimensionlessUnit x)
noexcept
251 return dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>(
252 std::acosh(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>()));
263 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
264 dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
asinh(
const dimensionlessUnit x)
noexcept
266 return dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>(
267 std::asinh(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>()));
279 template<
class dimensionlessUnit, std::enable_if_t<traits::is_dimensionless_unit_v<dimensionlessUnit>,
int> = 0>
280 dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>
atanh(
const dimensionlessUnit x)
noexcept
282 return dimensionless<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>(
283 std::atanh(x.template to<detail::floating_point_promotion_t<typename dimensionlessUnit::underlying_type>>()));
unit, dimensional analysis, generic cmath functions, traits (not dimension-specific),...
#define UNIT_ADD(namespaceName, namePlural, abbreviation,...)
Macro for generating the boilerplate code needed for a new unit.
Definition core.h:447
#define UNIT_ADD_WITH_METRIC_PREFIXES(namespaceName, namePlural, abbreviation,...)
Macro for generating the boilerplate code needed for a new unit, including its metric prefixes from f...
Definition core.h:529
#define UNIT_ADD_DIMENSION_TRAIT(unitdimension, ConceptName)
Macro to create the is_dimension_unit type trait and the ConceptName concept.
Definition core.h:488
constexpr To convert(const From &value) noexcept
converts a value from an unit to another.
Definition core.h:2345
typename detail::prefix< std::milli, Cf >::type milli
< Represents the type of class Cf with the metric 'micro' prefix appended.
Definition core.h:1998
radians< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > asin(const dimensionlessUnit x) noexcept
Compute arc sine.
Definition angle.h:145
dimensionless< detail::floating_point_promotion_t< typename AngleUnit::underlying_type > > tan(const AngleUnit angle) noexcept
Compute tangent.
Definition angle.h:118
dimensionless< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > asinh(const dimensionlessUnit x) noexcept
Compute arc hyperbolic sine.
Definition angle.h:264
dimensionless< detail::floating_point_promotion_t< typename AngleUnit::underlying_type > > sin(const AngleUnit angle) noexcept
Compute sine.
Definition angle.h:105
radians< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > acos(const dimensionlessUnit x) noexcept
Compute arc cosine.
Definition angle.h:131
dimensionless< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > sinh(const dimensionlessUnit x) noexcept
Compute hyperbolic sine.
Definition angle.h:218
dimensionless< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > tanh(const dimensionlessUnit x) noexcept
Compute hyperbolic tangent.
Definition angle.h:234
dimensionless< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > acosh(const dimensionlessUnit x) noexcept
Compute arc hyperbolic cosine.
Definition angle.h:249
dimensionless< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > atanh(const dimensionlessUnit x) noexcept
Compute arc hyperbolic tangent.
Definition angle.h:280
dimensionless< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > cosh(const dimensionlessUnit x) noexcept
Compute hyperbolic cosine.
Definition angle.h:202
dimensionless< detail::floating_point_promotion_t< typename AngleUnit::underlying_type > > cos(const AngleUnit angle) noexcept
Compute cosine.
Definition angle.h:91
radians< detail::floating_point_promotion_t< typename dimensionlessUnit::underlying_type > > atan(const dimensionlessUnit x) noexcept
Compute arc tangent.
Definition angle.h:163
radians< detail::floating_point_promotion_t< std::common_type_t< typename X::underlying_type, typename Y::underlying_type > > > atan2(const Y y, const X x) noexcept
Compute arc tangent with two parameters.
Definition angle.h:179
namespace for unit types and containers representing angle values
make_dimension< angle_tag > angle
< Represents a quantity with no dimension.
Definition core.h:1334
namespace representing type traits which can access the properties of types provided by the units lib...
Definition core.h:197
Unit Conversion Library namespace.
Definition units.h:106
Type representing an arbitrary conversion factor between units.
Definition core.h:1563