mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 02:17:16 +02:00
fix: broken concept names fixed
This commit is contained in:
@ -29,7 +29,7 @@
|
||||
|
||||
using namespace mp_units;
|
||||
|
||||
constexpr quantity_of<isq::speed> auto avg_speed(quantity_of<isq::distance> auto d, quantity_of<isq::duration> auto t)
|
||||
constexpr QuantityOf<isq::speed> auto avg_speed(QuantityOf<isq::distance> auto d, QuantityOf<isq::duration> auto t)
|
||||
{
|
||||
return quantity_cast<isq::speed>(d / t);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ void example()
|
||||
const auto a = isq::acceleration(measurement{9.8, 0.1}, m / s2);
|
||||
const auto t = isq::time(measurement{1.2, 0.1}, s);
|
||||
|
||||
const weak_quantity_of<isq::velocity> auto v = a * t;
|
||||
const WeakQuantityOf<isq::velocity> auto v = a * t;
|
||||
std::cout << a << " * " << t << " = " << v << " = " << v[km / h] << '\n';
|
||||
|
||||
const auto length = isq::length(measurement{123., 1.}, si::metre);
|
||||
|
@ -41,7 +41,7 @@ int main()
|
||||
const auto lever = isq_angle::position_vector[cm](20);
|
||||
const auto force = isq_angle::force[N](500);
|
||||
const auto angle = isq_angle::angular_measure[deg](90.);
|
||||
const weak_quantity_of<isq_angle::torque> auto torque =
|
||||
const WeakQuantityOf<isq_angle::torque> auto torque =
|
||||
lever * force * angular::sin(angle) / isq_angle::cotes_angle(1);
|
||||
|
||||
std::cout << "Applying a perpendicular force of " << force << " to a " << lever << " long lever results in "
|
||||
|
@ -37,9 +37,9 @@ namespace {
|
||||
|
||||
using namespace mp_units;
|
||||
|
||||
quantity_of<isq::mechanical_energy> auto total_energy(weak_quantity_of<isq::momentum> auto p,
|
||||
weak_quantity_of<isq::mass> auto m,
|
||||
weak_quantity_of<isq::speed> auto c)
|
||||
QuantityOf<isq::mechanical_energy> auto total_energy(WeakQuantityOf<isq::momentum> auto p,
|
||||
WeakQuantityOf<isq::mass> auto m,
|
||||
WeakQuantityOf<isq::speed> auto c)
|
||||
{
|
||||
return quantity_cast<isq::mechanical_energy>(sqrt(pow<2>(p * c) + pow<2>(m * pow<2>(c))));
|
||||
}
|
||||
@ -49,9 +49,9 @@ void si_example()
|
||||
using namespace mp_units::si::unit_symbols;
|
||||
constexpr auto GeV = si::giga<si::electronvolt>;
|
||||
|
||||
constexpr quantity_of<isq::speed> auto c = si::si2019::speed_of_light_in_vacuum(1.);
|
||||
const weak_quantity_of<isq::momentum> auto p1 = isq::mechanical_energy(4., GeV) / c;
|
||||
const weak_quantity_of<isq::mass> auto m1 = isq::mechanical_energy(3., GeV) / pow<2>(c);
|
||||
constexpr QuantityOf<isq::speed> auto c = si::si2019::speed_of_light_in_vacuum(1.);
|
||||
const WeakQuantityOf<isq::momentum> auto p1 = isq::mechanical_energy(4., GeV) / c;
|
||||
const WeakQuantityOf<isq::mass> auto m1 = isq::mechanical_energy(3., GeV) / pow<2>(c);
|
||||
const auto E = total_energy(p1, m1, c);
|
||||
|
||||
std::cout << "\n*** SI units (c = " << c << " = " << c[si::metre / s] << ") ***\n";
|
||||
@ -88,9 +88,9 @@ void natural_example()
|
||||
using namespace mp_units::natural;
|
||||
using namespace mp_units::natural::unit_symbols;
|
||||
|
||||
constexpr quantity_of<isq::speed> auto c = 1. * speed_of_light_in_vacuum;
|
||||
const quantity_of<isq::momentum> auto p = 4. * momentum[GeV];
|
||||
const quantity_of<isq::mass> auto m = 3. * mass[GeV];
|
||||
constexpr QuantityOf<isq::speed> auto c = 1. * speed_of_light_in_vacuum;
|
||||
const QuantityOf<isq::momentum> auto p = 4. * momentum[GeV];
|
||||
const QuantityOf<isq::mass> auto m = 3. * mass[GeV];
|
||||
const auto E = total_energy(p, m, c);
|
||||
|
||||
std::cout << "\n*** Natural units (c = " << c << ") ***\n"
|
||||
|
Reference in New Issue
Block a user