LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
QAngle.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
13#include <cmath>
14
15namespace okapi {
16QUANTITY_TYPE(0, 0, 0, 1, QAngle)
17
18constexpr QAngle radian(1.0);
19constexpr QAngle degree = static_cast<double>(2_pi / 360.0) * radian;
20
21inline namespace literals {
22constexpr QAngle operator"" _rad(long double x) {
23 return QAngle(x);
24}
25constexpr QAngle operator"" _rad(unsigned long long int x) {
26 return QAngle(static_cast<double>(x));
27}
28constexpr QAngle operator"" _deg(long double x) {
29 return static_cast<double>(x) * degree;
30}
31constexpr QAngle operator"" _deg(unsigned long long int x) {
32 return static_cast<double>(x) * degree;
33}
34} // namespace literals
35} // namespace okapi
#define QUANTITY_TYPE(_Mdim, _Ldim, _Tdim, _Adim, name)
Definition RQuantity.hpp:84
constexpr QAngle radian(1.0)
constexpr QAngle degree
Definition QAngle.hpp:19
@ x
Roll Axis.