constants.h
Go to the documentation of this file.
1 #pragma once
2 #include <Eigen/Core>
3 
4 #ifndef EIGEN_PI
5 # define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L
6 #endif
7 
8 namespace mc_rtc
9 {
10 namespace constants
11 {
12 
13 constexpr double GRAVITY = 9.80665; // ISO 80000-3
14 
16 const Eigen::Vector3d gravity = Eigen::Vector3d{0., 0., GRAVITY};
17 const Eigen::Vector3d vertical = Eigen::Vector3d{0., 0., 1.};
18 constexpr double PI = static_cast<double>(EIGEN_PI);
19 
27 constexpr double toDeg(const double rad)
28 {
29  return rad * 180. / PI;
30 }
31 
39 constexpr double toRad(const double degrees)
40 {
41  return degrees * PI / 180.;
42 }
43 
44 } // namespace constants
45 } // namespace mc_rtc
EIGEN_PI
#define EIGEN_PI
Definition: constants.h:5
mc_rtc::constants::gravity
const Eigen::Vector3d gravity
Definition: constants.h:16
mc_rtc::constants::vertical
const Eigen::Vector3d vertical
Definition: constants.h:17
mc_rtc::constants::GRAVITY
constexpr double GRAVITY
Definition: constants.h:13
mc_rtc::constants::PI
constexpr double PI
Definition: constants.h:18
mc_rtc::constants::toRad
constexpr double toRad(const double degrees)
Converts degrees to radians.
Definition: constants.h:39
mc_rtc::constants::toDeg
constexpr double toDeg(const double rad)
Converts radians to degrees.
Definition: constants.h:27
mc_rtc
Definition: Contact.h:87