Trigonometry.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarX::Core
17 * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18 * @date 2015
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
25 #include <math.h>
26 
27 namespace armarx::math
28 {
30  {
31  public:
32  static float Deg2RadF(const float angle)
33  {
34  return angle / 180.0f * M_PI;
35  }
36  static double Deg2RadD(const double angle)
37  {
38  return angle / 180.0 * M_PI;
39  }
40  static float Rad2DegF(const float rad)
41  {
42  return rad / M_PI * 180.0f;
43  }
44  static double Rad2DegD(const float rad)
45  {
46  return rad / M_PI * 180.0;
47  }
48 
49  static double GetAngleFromVectorXY(const Eigen::Vector3f& vector)
50  {
51  return atan2(vector(1), vector(0));
52  }
53  };
54 }
55 
56 
armarx::math::Trigonometry::Deg2RadD
static double Deg2RadD(const double angle)
Definition: Trigonometry.h:36
armarx::math::Trigonometry::GetAngleFromVectorXY
static double GetAngleFromVectorXY(const Eigen::Vector3f &vector)
Definition: Trigonometry.h:49
armarx::math::Trigonometry
Definition: Trigonometry.h:29
armarx::math::Trigonometry::Rad2DegF
static float Rad2DegF(const float rad)
Definition: Trigonometry.h:40
armarx::math::Trigonometry::Deg2RadF
static float Deg2RadF(const float angle)
Definition: Trigonometry.h:32
M_PI
#define M_PI
Definition: MathTools.h:17
armarx::math::Trigonometry::Rad2DegD
static double Rad2DegD(const float rad)
Definition: Trigonometry.h:44
armarx::math
Definition: LinearizeAngularTrajectory.cpp:27
angle
double angle(const Point &a, const Point &b, const Point &c)
Definition: point.hpp:100