forked from mpusz/mp-units
Velocity renamed to Speed (resolves #103)
This commit is contained in:
@@ -35,7 +35,7 @@ namespace units::detail {
|
||||
* quantities as a product of powers of factors corresponding to the base quantities, omitting any numerical factors.
|
||||
* A power of a factor is the factor raised to an exponent.
|
||||
*
|
||||
* A derived dimension can be formed from multiple exponents (i.e. velocity is represented as "exp<L, 1>, exp<T, -1>").
|
||||
* A derived dimension can be formed from multiple exponents (i.e. speed is represented as "exp<L, 1>, exp<T, -1>").
|
||||
* It is also possible to form a derived dimension with only one exponent (i.e. frequency is represented as just
|
||||
* "exp<T, -1>").
|
||||
*
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <units/physical/dimensions.h>
|
||||
#include <units/physical/cgs/velocity.h>
|
||||
#include <units/physical/cgs/speed.h>
|
||||
#include <units/quantity.h>
|
||||
|
||||
namespace units::physical::cgs {
|
||||
|
||||
@@ -33,13 +33,13 @@ struct centimetre_per_second : unit<centimetre_per_second> {};
|
||||
struct dim_velocity : physical::dim_velocity<dim_velocity, centimetre_per_second, dim_length, dim_time> {};
|
||||
|
||||
template<Unit U, Scalar Rep = double>
|
||||
using velocity = quantity<dim_velocity, U, Rep>;
|
||||
using speed = quantity<dim_velocity, U, Rep>;
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
// cmps
|
||||
constexpr auto operator"" q_cm_per_s(unsigned long long l) { return velocity<centimetre_per_second, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_cm_per_s(long double l) { return velocity<centimetre_per_second, long double>(l); }
|
||||
constexpr auto operator"" q_cm_per_s(unsigned long long l) { return speed<centimetre_per_second, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_cm_per_s(long double l) { return speed<centimetre_per_second, long double>(l); }
|
||||
|
||||
} // namespace literals
|
||||
|
||||
@@ -207,7 +207,7 @@ template<typename T>
|
||||
concept Volume = QuantityOf<T, dim_volume>;
|
||||
|
||||
template<typename T>
|
||||
concept Velocity = QuantityOf<T, dim_velocity>;
|
||||
concept Speed = QuantityOf<T, dim_velocity>;
|
||||
|
||||
template<typename T>
|
||||
concept Acceleration = QuantityOf<T, dim_acceleration>;
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/physical/si/velocity.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/international/length.h>
|
||||
|
||||
namespace units::physical::international {
|
||||
@@ -32,8 +32,8 @@ struct mile_per_hour : deduced_unit<mile_per_hour, si::dim_velocity, internation
|
||||
inline namespace literals {
|
||||
|
||||
// mph
|
||||
constexpr auto operator"" q_mi_per_h(unsigned long long l) { return si::velocity<mile_per_hour, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_mi_per_h(long double l) { return si::velocity<mile_per_hour, long double>(l); }
|
||||
constexpr auto operator"" q_mi_per_h(unsigned long long l) { return si::speed<mile_per_hour, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_mi_per_h(long double l) { return si::speed<mile_per_hour, long double>(l); }
|
||||
|
||||
} // namespace literals
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
namespace units::physical::natural {
|
||||
|
||||
template<Scalar Rep = double>
|
||||
inline constexpr auto speed_of_light = velocity<unitless, Rep>(1);
|
||||
inline constexpr auto speed_of_light = speed<unitless, Rep>(1);
|
||||
|
||||
} // namespace units::physical::natural
|
||||
|
||||
@@ -42,7 +42,7 @@ using mass = quantity<dim_mass, U, Rep>;
|
||||
|
||||
struct dim_velocity : physical::dim_velocity<dim_velocity, unitless, dim_length, dim_time> {};
|
||||
template<Unit U, Scalar Rep = double>
|
||||
using velocity = quantity<dim_velocity, U, Rep>;
|
||||
using speed = quantity<dim_velocity, U, Rep>;
|
||||
|
||||
struct dim_acceleration : physical::dim_acceleration<dim_acceleration, gigaelectronvolt, dim_length, dim_time> {};
|
||||
template<Unit U, Scalar Rep = double>
|
||||
|
||||
@@ -49,6 +49,6 @@
|
||||
#include "si/resistance.h"
|
||||
#include "si/surface_tension.h"
|
||||
#include "si/thermal_conductivity.h"
|
||||
#include "si/velocity.h"
|
||||
#include "si/speed.h"
|
||||
#include "si/voltage.h"
|
||||
#include "si/volume.h"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <units/physical/dimensions.h>
|
||||
#include <units/physical/si/velocity.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/quantity.h>
|
||||
|
||||
namespace units::physical::si {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <units/physical/si/power.h>
|
||||
#include <units/physical/si/substance.h>
|
||||
#include <units/physical/si/temperature.h>
|
||||
#include <units/physical/si/velocity.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
|
||||
namespace units::physical::si::si2019 {
|
||||
|
||||
@@ -48,7 +48,7 @@ template<Scalar Rep = double>
|
||||
inline constexpr auto avogadro_constant = Rep(6.02214076e23) / substance<mole, Rep>(1);
|
||||
|
||||
template<Scalar Rep = double>
|
||||
inline constexpr auto speed_of_light = velocity<metre_per_second, Rep>(299'792'458);
|
||||
inline constexpr auto speed_of_light = speed<metre_per_second, Rep>(299'792'458);
|
||||
|
||||
template<Scalar Rep = double>
|
||||
inline constexpr auto hyperfine_structure_transition_frequency = frequency<hertz, Rep>(9'192'631'770);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <units/physical/dimensions.h>
|
||||
#include <units/physical/si/mass.h>
|
||||
#include <units/physical/si/velocity.h>
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/quantity.h>
|
||||
|
||||
namespace units::physical::si {
|
||||
|
||||
@@ -35,17 +35,17 @@ struct dim_velocity : physical::dim_velocity<dim_velocity, metre_per_second, dim
|
||||
struct kilometre_per_hour : deduced_unit<kilometre_per_hour, dim_velocity, kilometre, hour> {};
|
||||
|
||||
template<Unit U, Scalar Rep = double>
|
||||
using velocity = quantity<dim_velocity, U, Rep>;
|
||||
using speed = quantity<dim_velocity, U, Rep>;
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
// mps
|
||||
constexpr auto operator"" q_m_per_s(unsigned long long l) { return velocity<metre_per_second, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_m_per_s(long double l) { return velocity<metre_per_second, long double>(l); }
|
||||
constexpr auto operator"" q_m_per_s(unsigned long long l) { return speed<metre_per_second, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_m_per_s(long double l) { return speed<metre_per_second, long double>(l); }
|
||||
|
||||
// kmph
|
||||
constexpr auto operator"" q_km_per_h(unsigned long long l) { return velocity<kilometre_per_hour, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_km_per_h(long double l) { return velocity<kilometre_per_hour, long double>(l); }
|
||||
constexpr auto operator"" q_km_per_h(unsigned long long l) { return speed<kilometre_per_hour, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_km_per_h(long double l) { return speed<kilometre_per_hour, long double>(l); }
|
||||
|
||||
} // namespace literals
|
||||
|
||||
Reference in New Issue
Block a user