feat: arcminute and arcsecond support added

This commit is contained in:
Mateusz Pusz
2023-06-19 14:01:36 +02:00
parent 6db8012513
commit 7fc88facd6
3 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);