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
27namespace armarx::math
28{
30 {
31 public:
32 static float
33 Deg2RadF(const float angle)
34 {
35 return angle / 180.0f * M_PI;
36 }
37
38 static double
39 Deg2RadD(const double angle)
40 {
41 return angle / 180.0 * M_PI;
42 }
43
44 static float
45 Rad2DegF(const float rad)
46 {
47 return rad / M_PI * 180.0f;
48 }
49
50 static double
51 Rad2DegD(const float rad)
52 {
53 return rad / M_PI * 180.0;
54 }
55
56 static double
57 GetAngleFromVectorXY(const Eigen::Vector3f& vector)
58 {
59 return atan2(vector(1), vector(0));
60 }
61 };
62} // namespace armarx::math
#define M_PI
Definition MathTools.h:17
static double GetAngleFromVectorXY(const Eigen::Vector3f &vector)
static double Rad2DegD(const float rad)
static float Deg2RadF(const float angle)
static double Deg2RadD(const double angle)
static float Rad2DegF(const float rad)
double angle(const Point &a, const Point &b, const Point &c)
Definition point.hpp:109