forked from mpusz/mp-units
feat: 𝜋 added as an alias for pi
This commit is contained in:
@@ -696,6 +696,7 @@ inline constexpr struct pi final : mag_constant<symbol_text{u8"𝜋", "pi"}> {
|
||||
inline constexpr struct pi final : mag_constant<symbol_text{u8"𝜋", "pi"}, std::numbers::pi_v<long double>> {
|
||||
#endif
|
||||
} pi;
|
||||
inline constexpr auto 𝜋 = pi;
|
||||
|
||||
[[deprecated("Use `mag<pi>` instead")]] inline constexpr Magnitude auto mag_pi = mag<pi>;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ QUANTITY_SPEC(angle, dim_angle);
|
||||
QUANTITY_SPEC(solid_angle, pow<2>(angle));
|
||||
|
||||
inline constexpr struct radian final : named_unit<"rad", kind_of<angle>> {} radian;
|
||||
inline constexpr struct revolution final : named_unit<"rev", mag<2> * mag<pi> * radian> {} revolution;
|
||||
inline constexpr struct revolution final : named_unit<"rev", mag<2> * mag<𝜋> * radian> {} revolution;
|
||||
inline constexpr struct degree final : named_unit<symbol_text{u8"°", "deg"}, mag_ratio<1, 360> * revolution> {} degree;
|
||||
inline constexpr struct gradian final : named_unit<symbol_text{u8"ᵍ", "grad"}, mag_ratio<1, 400> * revolution> {} gradian;
|
||||
inline constexpr struct steradian final : named_unit<"sr", square(radian)> {} steradian;
|
||||
|
||||
@@ -57,7 +57,7 @@ inline constexpr struct luminous_efficacy final :
|
||||
inline constexpr struct standard_gravity final :
|
||||
named_unit<symbol_text{u8"g₀", "g_0"}, mag_ratio<980'665, 100'000> * metre / square(second)> {} standard_gravity;
|
||||
inline constexpr struct magnetic_constant final :
|
||||
named_unit<symbol_text{u8"μ₀", "u_0"}, mag<4> * mag<pi> * mag_power<10, -7> * henry / metre> {} magnetic_constant;
|
||||
named_unit<symbol_text{u8"μ₀", "u_0"}, mag<4> * mag<𝜋> * mag_power<10, -7> * henry / metre> {} magnetic_constant;
|
||||
// clang-format on
|
||||
|
||||
} // namespace mp_units::si
|
||||
|
||||
@@ -100,7 +100,7 @@ inline constexpr struct minute final : named_unit<"min", mag<60> * si::second> {
|
||||
inline constexpr struct hour final : named_unit<"h", mag<60> * minute> {} hour;
|
||||
inline constexpr struct day final : named_unit<"d", mag<24> * hour> {} day;
|
||||
inline constexpr struct astronomical_unit final : named_unit<"au", mag<149'597'870'700> * si::metre> {} astronomical_unit;
|
||||
inline constexpr struct degree final : named_unit<symbol_text{u8"°", "deg"}, mag<pi> / mag<180> * si::radian> {} degree;
|
||||
inline constexpr struct degree final : named_unit<symbol_text{u8"°", "deg"}, mag<𝜋> / mag<180> * si::radian> {} degree;
|
||||
inline constexpr struct arcminute final : named_unit<symbol_text{u8"′", "'"}, mag_ratio<1, 60> * degree> {} arcminute;
|
||||
inline constexpr struct arcsecond final : named_unit<symbol_text{u8"″", "''"}, mag_ratio<1, 60> * arcminute> {} arcsecond;
|
||||
inline constexpr struct are final : named_unit<"a", square(si::deca<si::metre>)> {} are;
|
||||
|
||||
Reference in New Issue
Block a user