mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-29 18:07:16 +02:00
feat: arcminute
and arcsecond
support added
This commit is contained in:
@ -733,6 +733,8 @@ inline constexpr auto Qkat = quetta<katal>;
|
||||
// TODO Should the following non-SI units have prefixes symbols predefiend as well?
|
||||
inline constexpr auto au = astronomical_unit;
|
||||
inline constexpr auto deg = degree;
|
||||
inline constexpr auto arcmin = arcminute;
|
||||
inline constexpr auto arcsec = arcsecond;
|
||||
inline constexpr auto a = are;
|
||||
inline constexpr auto ha = hectare;
|
||||
inline constexpr auto l = litre;
|
||||
|
@ -82,9 +82,8 @@ inline constexpr struct hour : named_unit<"h", mag<60> * minute> {} hour;
|
||||
inline constexpr struct day : named_unit<"d", mag<24> * hour> {} day;
|
||||
inline constexpr struct astronomical_unit : named_unit<"au", mag<149'597'870'700> * metre> {} astronomical_unit;
|
||||
inline constexpr struct degree : named_unit<basic_symbol_text{"°", "deg"}, mag_pi / mag<180> * radian> {} degree;
|
||||
// TODO how to disambiguate below angular units from time units (inline namespace `plane_angle`?)
|
||||
// inline constexpr struct minute : named_unit<basic_symbol_text{"′", "'"}, mag<ratio{1, 60}> * degree> {} minute;
|
||||
// inline constexpr struct second : named_unit<basic_symbol_text{"″", "''"}, mag<ratio{1, 60}> * minute> {} second;
|
||||
inline constexpr struct arcminute : named_unit<basic_symbol_text{"′", "'"}, mag<ratio{1, 60}> * degree> {} arcminute;
|
||||
inline constexpr struct arcsecond : named_unit<basic_symbol_text{"″", "''"}, mag<ratio{1, 60}> * arcminute> {} arcsecond;
|
||||
inline constexpr struct are : named_unit<"a", square(deca<metre>)> {} are;
|
||||
inline constexpr struct hectare : decltype(hecto<are>) {} hectare;
|
||||
inline constexpr struct litre : named_unit<"l", cubic(deci<metre>)> {} litre;
|
||||
|
@ -78,6 +78,9 @@ static_assert(1 * d == 24 * h);
|
||||
|
||||
static_assert(1 * au == 149'597'870'700 * m);
|
||||
|
||||
static_assert(60. * arcmin == 1. * deg);
|
||||
static_assert(60. * arcsec == 1. * arcmin);
|
||||
|
||||
static_assert(1 * a == 100 * m2);
|
||||
static_assert(1 * ha == 100 * a);
|
||||
|
||||
|
Reference in New Issue
Block a user