|
Brick
|
Classes | |
| class | Quantity |
| class | Temperature |
Concepts | |
| concept | IsQuantity |
| Used to require a Quantity be passed in a template (instead of typename Q). | |
| concept | Isomorphic |
| Isomorphic concept checks whether dimensions are the same between quantities. | |
| concept | IsomorphicValues |
| concept | KinematicQuantity |
| Only allows nonzero length, time, angle for the next two functions. | |
Typedefs | |
| using | Number = Quantity<> |
| Number is just dimensionless. | |
| template<IsQuantity Q1, IsQuantity Q2> | |
| using | Multiplied |
| Multiplying quantities adds their dimensions. | |
| template<IsQuantity Q1, IsQuantity Q2> | |
| using | Divided |
| Dividing quantities subtracts their dimensions. | |
| template<IsQuantity Q, typename factor> | |
| using | Exponentiated |
| Exponentiating a quantity multiplies its dimensions by the power. | |
| template<IsQuantity Q, typename quotient> | |
| using | Rooted |
| Rooting a quantity divides its dimensions by the root. | |
| using | LinearVelocityProportionalGain = LinearDerivativeGain |
| using | TemperatureQuantity |
| template<typename T> | |
| using | quantity_type = decltype(to_quantity(std::declval<T>())) |
Enumerations | |
| enum class | TemperatureUnit { Kelvin , Celsius , Fahrenheit } |
Functions | |
| template<typename Mass = std::ratio<0>, typename Length = std::ratio<0>, typename Time = std::ratio<0>, typename Current = std::ratio<0>, typename Angle = std::ratio<0>, typename Temperature = std::ratio<0>, typename Luminosity = std::ratio<0>, typename Moles = std::ratio<0>> | |
| void | quantity_checker (Quantity< Mass, Length, Time, Current, Angle, Temperature, Luminosity, Moles >) |
| quantity checker. Used by the is_quantity concept | |
| template<IsQuantity Q> | |
| constexpr Q | from (double value, Q unit) |
| template<IsQuantity Q> | |
| constexpr Q | operator+ (Q rhs) |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr Q | operator+ (Q lhs, R rhs) |
| Add two isomorphic quantities. | |
| template<IsQuantity Q> | |
| constexpr Q | operator- (Q rhs) |
| Negate a quantity. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr Q | operator- (Q lhs, R rhs) |
| Subtract two isomorphic quantities. | |
|
template<IsQuantity Q> requires (!std::is_same_v<Q, Number>) | |
| constexpr Q | operator* (Q quantity, Number multiple) |
| Multiply a Quantity by a Number. | |
|
template<IsQuantity Q> requires (!std::is_same_v<Q, Number>) | |
| constexpr Q | operator* (Number multiple, Q quantity) |
| Multiply a Quantity by a Number. | |
|
template<IsQuantity Q> requires (!std::is_same_v<Q, Number>) | |
| constexpr Q | operator/ (Q quantity, Number divisor) |
| Divide a Quantity by a Number. | |
|
template<IsQuantity Q> requires (!std::is_same_v<Q, Number>) | |
| constexpr auto | operator/ (Number enumerator, Q divisor) |
| Divide a Number by a Quantity. | |
| template<IsQuantity Q1, IsQuantity Q2> | |
| constexpr auto | operator* (Q1 lhs, Q2 rhs) |
| Multiply two Quantities. | |
| template<IsQuantity Q1, IsQuantity Q2> | |
| constexpr auto | operator/ (Q1 lhs, Q2 rhs) |
| Divide two Quantities. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr bool | operator== (const Q &lhs, const R &rhs) |
| Check whether two Quantities are equal. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr bool | operator!= (const Q &lhs, const R &rhs) |
| Check whether two Quantities are not equal. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr bool | operator<= (const Q &lhs, const R &rhs) |
| Check whether a Quantity is less than or equal to another. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr bool | operator>= (const Q &lhs, const R &rhs) |
| Check whether a Quantity is greater than or equal to another. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr bool | operator< (const Q &lhs, const R &rhs) |
| Check whether a Quantity is less than another. | |
|
template<IsQuantity Q, IsQuantity R> requires Isomorphic<Q, R> | |
| constexpr bool | operator> (const Q &lhs, const R &rhs) |
| Check whether a Quantity is greater than another. | |
| NEW_UNIT (LinearAccelerationFeedforward, volts_per_meter_per_second_squared, VpMps2, 1, 1, -1, -1, 0, 0, 0, 0) NEW_UNIT_LITERAL(LinearAccelerationFeedforward | |
| Tile is the measured length of a vex field tile in real life. | |
| NEW_UNIT (LinearVelocityDerivativeGain, volt_seconds_squared_per_meter, Vs2pM, 1, 1, -1, -1, 0, 0, 0, 0) using LinearVelocityIntegralGain | |
| NEW_UNIT (AngularVelocityFeedforward, volts_per_radian_per_second, VpRadPs, 1, 2, -2, -1, -1, 0, 0, 0) NEW_UNIT(AngularAccelerationFeedforward | |
| NEW_UNIT_LITERAL (AngularAccelerationFeedforward, volts_per_degree_per_second_squared, VpDegPs2, V/dps2) using AngularVelocityProportionalGain | |
| NEW_UNIT (AngularVelocityDerivativeGain, volt_seconds_squared_per_radian, Vs2pRad, 1, 2, -1, -1, -1, 0, 0, 0) using AngularVelocityIntegralGain | |
| constexpr Temperature | from (double value, TemperatureUnit unit) |
| constexpr Temperature | operator+ (Temperature)=delete |
| constexpr Temperature | operator- (Temperature)=delete |
| constexpr Temperature | operator+ (Temperature, Temperature)=delete |
| constexpr Temperature | operator- (Temperature, Temperature)=delete |
| template<typename T> | |
| constexpr auto | to_quantity (T value) -> std::conditional_t< std::is_arithmetic_v< T >, Number, T > |
| template<typename T> | |
| constexpr auto | abs (const T &lhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | max (const T &lhs, const U &rhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | min (const T &lhs, const U &rhs) |
| template<typename T> | |
| constexpr auto | sgn (const T &lhs) |
|
template<int R, typename T> requires IsQuantity<quantity_type<T>> | |
| constexpr auto | pow (const T &lhs) |
| template<typename T> | |
| constexpr auto | square (const T &lhs) |
| template<typename T> | |
| constexpr auto | cube (const T &lhs) |
|
template<int R, typename T> requires (R > 0) | |
| constexpr auto | root (const T &lhs) |
| template<typename T> | |
| constexpr auto | sqrt (const T &lhs) |
| template<typename T> | |
| constexpr auto | cbrt (const T &lhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | hypot (const T &lhs, const U &rhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | mod (const T &lhs, const U &rhs) |
| template<typename T, typename U> | |
| constexpr auto | copysign (const T &lhs, const U &rhs) |
| template<typename T> | |
| constexpr auto | signbit (const T &lhs) |
|
template<typename T, typename U, typename V> requires IsomorphicValues<T, U, V> | |
| constexpr auto | clamp (const T &lhs, const U &lo, const V &hi) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | ceil (const T &lhs, const U &rhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | floor (const T &lhs, const U &rhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | trunc (const T &lhs, const U &rhs) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr auto | round (const T &lhs, const U &rhs) |
| template<KinematicQuantity Q> requires std::ratio_equal_v<typename Q::angle, std::ratio<1>> && std::ratio_equal_v<typename Q::length, std::ratio<0>> | |
| constexpr auto | to_linear (Q angular_distance, Length diameter) |
| template<KinematicQuantity Q> requires std::ratio_equal_v<typename Q::length, std::ratio<1>> && std::ratio_equal_v<typename Q::angle, std::ratio<0>> | |
| constexpr auto | to_angular (Q linear_distance, Length diameter) |
| constexpr Number | sin (Angle angle) |
| constexpr Number | cos (Angle angle) |
| constexpr Number | tan (Angle angle) |
| constexpr Angle | asin (Number value) |
| constexpr Angle | acos (Number value) |
| constexpr Angle | atan (Number value) |
|
template<typename T, typename U> requires IsomorphicValues<T, U> | |
| constexpr Angle | atan2 (const T &y, const U &x) |
| constexpr Angle | wrap_positive (Angle angle) |
| constexpr Angle | wrap_signed (Angle angle) |
| constexpr Angle | shortest_difference (Angle start, Angle end) |
| using units::Divided |
Dividing quantities subtracts their dimensions.
| using units::Exponentiated |
Exponentiating a quantity multiplies its dimensions by the power.
| using units::Multiplied |
Multiplying quantities adds their dimensions.
| using units::Rooted |
Rooting a quantity divides its dimensions by the root.
| using units::TemperatureQuantity |
|
constexpr |
Creates a quantity from a numeric value expressed in a specific unit. e.g. Velocity v = from(5, inps);
|
constexpr |
Helper to go from linear to angular, like from wheel distance travel to wheel rotation
|
constexpr |
Helper to go from angular to linear, like from encoder rotation to wheel distance travel