Si.hh
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <boost/math/constants/constants.hpp>
7 
8 #include <boost/units/quantity.hpp>
9 #include <boost/units/systems/si/plane_angle.hpp>
10 #include <boost/units/systems/si/length.hpp>
11 #include <boost/units/cmath.hpp>
12 
13 
14 namespace boca
15 {
16 
17 namespace units
18 {
19 
24 using Length = boost::units::quantity<boost::units::si::length>;
25 
26 BOOST_UNITS_STATIC_CONSTANT(meter, boost::units::si::length);
27 BOOST_UNITS_STATIC_CONSTANT(meters, boost::units::si::length);
28 BOOST_UNITS_STATIC_CONSTANT(metre, boost::units::si::length);
29 BOOST_UNITS_STATIC_CONSTANT(metres, boost::units::si::length);
30 
35 using Angle = boost::units::quantity<boost::units::si::plane_angle>;
36 
37 using AngleSquare = typename boost::units::multiply_typeof_helper<Angle, Angle>::type;
38 
39 BOOST_UNITS_STATIC_CONSTANT(radian, boost::units::si::plane_angle);
40 
41 BOOST_UNITS_STATIC_CONSTANT(radians, boost::units::si::plane_angle);
42 
46 constexpr double Pi()
47 {
48  return boost::math::constants::pi<double>();
49 }
50 
54 constexpr double TwoPi()
55 {
56  return boost::math::constants::two_pi<double>();
57 }
58 
62 Angle PiRad();
63 
67 Angle TwoPiRad();
68 
72 Angle Restrict(Angle phi);
73 
77 Angle Wrap(Angle phi);
78 
79 }
80 
81 using namespace units;
82 
83 }
boost::units::quantity< boost::units::si::plane_angle > Angle
Angle measured in radian.
Definition: Si.hh:35
constexpr double TwoPi()
Constant .
Definition: Si.hh:54
Angle PiRad()
Constant in rad.
Definition: Si.cpp:16
BOOST_UNITS_STATIC_CONSTANT(Barn, barn::Area)
Angle Wrap(Angle phi)
Wrap an angle by .
Definition: Si.cpp:33
boost::units::quantity< boost::units::si::length > Length
Length measured in meter.
Definition: Si.hh:24
Boosted Collider Analysis.
Definition: Analysis.hh:15
typename boost::units::multiply_typeof_helper< Angle, Angle >::type AngleSquare
Definition: Si.hh:37
Angle Restrict(Angle phi)
Restrict an angle to the interval .
Definition: Si.cpp:26
constexpr double Pi()
Constant .
Definition: Si.hh:46
Angle TwoPiRad()
Constant in rad.
Definition: Si.cpp:21