LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
QForce.hpp
Go to the documentation of this file.
1/*
2 * This code is a modified version of Benjamin Jurke's work in 2015. You can read his blog post
3 * here:
4 * https://benjaminjurke.com/content/articles/2015/compile-time-numerical-unit-dimension-checking/
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
10#pragma once
11
15
16namespace okapi {
17QUANTITY_TYPE(1, 1, -2, 0, QForce)
18
19constexpr QForce newton = (kg * meter) / (second * second);
20constexpr QForce poundforce = pound * G;
21constexpr QForce kilopond = kg * G;
22
23inline namespace literals {
24constexpr QForce operator"" _n(long double x) {
25 return QForce(x);
26}
27constexpr QForce operator"" _n(unsigned long long int x) {
28 return QForce(static_cast<double>(x));
29}
30constexpr QForce operator"" _lbf(long double x) {
31 return static_cast<double>(x) * poundforce;
32}
33constexpr QForce operator"" _lbf(unsigned long long int x) {
34 return static_cast<double>(x) * poundforce;
35}
36constexpr QForce operator"" _kp(long double x) {
37 return static_cast<double>(x) * kilopond;
38}
39constexpr QForce operator"" _kp(unsigned long long int x) {
40 return static_cast<double>(x) * kilopond;
41}
42} // namespace literals
43} // namespace okapi
#define QUANTITY_TYPE(_Mdim, _Ldim, _Tdim, _Adim, name)
Definition RQuantity.hpp:84
constexpr QMass pound
Definition QMass.hpp:21
constexpr QForce poundforce
Definition QForce.hpp:20
constexpr QLength meter(1.0)
constexpr QForce newton
Definition QForce.hpp:19
constexpr QAcceleration G
constexpr QForce kilopond
Definition QForce.hpp:21
@ x
Roll Axis.
constexpr QTime second(1.0)
constexpr QMass kg(1.0)