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
12namespace argos {
13 class CRadians;
14}
15
16#include <argos3/core/utility/math/matrix/squarematrix.h>
17#include <argos3/core/utility/math/vector2.h>
18
19namespace argos {
20
21 class CRotationMatrix2 : public CSquareMatrix<2> {
22
24
25 public:
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
float Real
Collects all ARGoS code.
Definition datatypes.h:39
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
It defines the basic type CRadians, used to store an angle value in radians.
Definition angles.h:42
Real m_pfValues[ROWS *COLS]
Definition matrix.h:222
CRotationMatrix2(const CRadians &c_angle)
CVector2 operator*(const CVector2 &c_vector) const
void SetFromAngle(const CRadians &c_angle)
CRotationMatrix2(const CMatrix< 2, 2 > &c_matrix)
CRotationMatrix2(Real f_value0, Real f_value1, Real f_value2, Real f_value3)
void SetFromValues(Real f_value0, Real f_value1, Real f_value2, Real f_value3)
void SetFromMatrix(const CMatrix< 2, 2 > &c_matrix)
A 2D vector class.
Definition vector2.h:27