ARGoS  3
A parallel, multi-engine simulator for swarm robotics
rotationmatrix2.h
Go to the documentation of this file.
1 
9 #ifndef ROTATION_MATRIX2_H
10 #define ROTATION_MATRIX2_H
11 
12 namespace argos {
13  class CRadians;
14 }
15 
16 #include "squarematrix.h"
17 #include <argos3/core/utility/math/vector2.h>
18 
19 namespace argos {
20 
21  class CRotationMatrix2 : public CSquareMatrix<2> {
22 
23  friend class CTransformationMatrix2;
24 
25  public:
28  }
29 
30  CRotationMatrix2(const CMatrix<2,2>& c_matrix) {
31  SetFromMatrix(c_matrix);
32  }
33 
34  CRotationMatrix2(const CRadians& c_angle) : CSquareMatrix<2>() {
35  SetFromAngle(c_angle);
36  }
37 
38  CRotationMatrix2(Real f_value0, Real f_value1,
39  Real f_value2, Real f_value3) : CSquareMatrix<2>() {
40  SetFromValues(f_value0, f_value1,
41  f_value2, f_value3);
42  }
43 
44  void SetFromMatrix(const CMatrix<2,2>& c_matrix);
45 
46  void SetFromAngle(const CRadians& c_angle);
47 
48  void SetFromValues(Real f_value0, Real f_value1,
49  Real f_value2, Real f_value3);
50 
51  CVector2 operator*(const CVector2& c_vector) const {
52  return CVector2(m_pfValues[0]*c_vector.m_fX + m_pfValues[1]*c_vector.m_fY,
53  m_pfValues[2]*c_vector.m_fX + m_pfValues[3]*c_vector.m_fY);
54  }
55  };
56 }
57 
58 #endif
argos::CTransformationMatrix2
Definition: transformationmatrix2.h:21
argos::CRotationMatrix2
Definition: rotationmatrix2.h:21
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CRadians
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
argos::CSquareMatrix
Definition: squarematrix.h:17
argos::CRotationMatrix2::SetFromValues
void SetFromValues(Real f_value0, Real f_value1, Real f_value2, Real f_value3)
Definition: rotationmatrix2.cpp:41
argos::CRotationMatrix2::CRotationMatrix2
CRotationMatrix2(const CRadians &c_angle)
Definition: rotationmatrix2.h:34
argos::CRotationMatrix2::CRotationMatrix2
CRotationMatrix2(Real f_value0, Real f_value1, Real f_value2, Real f_value3)
Definition: rotationmatrix2.h:38
argos::CVector2
A 2D vector class.
Definition: vector2.h:25
argos::CMatrix< DIM, DIM >::m_pfValues
Real m_pfValues[ROWS *COLS]
Definition: matrix.h:214
argos::CMatrix
Definition: matrix.h:20
argos::CRotationMatrix2::SetFromMatrix
void SetFromMatrix(const CMatrix< 2, 2 > &c_matrix)
Definition: rotationmatrix2.cpp:31
argos::CRotationMatrix2::operator*
CVector2 operator*(const CVector2 &c_vector) const
Definition: rotationmatrix2.h:51
argos::CRotationMatrix2::CRotationMatrix2
CRotationMatrix2()
Definition: rotationmatrix2.h:26
argos::CRotationMatrix2::SetFromAngle
void SetFromAngle(const CRadians &c_angle)
Definition: rotationmatrix2.cpp:17
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
argos::CSquareMatrix< 2 >::SetIdentityMatrix
void SetIdentityMatrix()
Definition: squarematrix.h:22
squarematrix.h
argos::CRotationMatrix2::CRotationMatrix2
CRotationMatrix2(const CMatrix< 2, 2 > &c_matrix)
Definition: rotationmatrix2.h:30