All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
rotarymatrices.h
1 /* Copyright (C) 2004-2012 Robert Huber
2 
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
17  *
18  * Contact: martin.o.foerg@googlemail.com
19  */
20 
21 #ifndef ROTARYMATRICES_H
22 #define ROTARYMATRICES_H
23 #include "fmatvec/fmatvec.h"
24 #include "mbsim/utils/utils.h"
25 
26 namespace MBSim {
27 
35  fmatvec::SqrMat BasicRotAKIx(double phi);
36  fmatvec::SqrMat BasicRotAKIy(double phi);
37  fmatvec::SqrMat BasicRotAKIz(double phi);
38 
39  /*
40  * \brief Rotate CoSy K (angle phi) to obtain CoSy I
41  */
42  fmatvec::SqrMat BasicRotAIKx(double phi);
43  fmatvec::SqrMat BasicRotAIKy(double phi);
44  fmatvec::SqrMat BasicRotAIKz(double phi);
45 
49  template<class Row>
51  fmatvec::Vector<Row,double> AlphaBetaGamma(AIK.size(),fmatvec::NONINIT);
52  AlphaBetaGamma(1)= asin(AIK(0,2));
53  double nenner = cos(AlphaBetaGamma(1));
54  if (fabs(nenner)>1e-10) {
55  AlphaBetaGamma(0) = atan2(-AIK(1,2),AIK(2,2));
56  AlphaBetaGamma(2) = atan2(-AIK(0,1),AIK(0,0));
57  } else {
58  AlphaBetaGamma(0)=0;
59  AlphaBetaGamma(2)=atan2(AIK(1,0),AIK(1,1));
60  }
61  return AlphaBetaGamma;
62  }
63 
64  template<class Row>
66  return AIK2Cardan(trans(AKI));
67  }
68 
72  template<class Row>
74  fmatvec::Vector<Row,double> AlphaBetaGamma(AIK.size(),fmatvec::NONINIT);
75  AlphaBetaGamma(1)= asin(-AIK(2,0));
76  double nenner = cos(AlphaBetaGamma(1));
77  if (fabs(nenner)>1e-10) {
78  AlphaBetaGamma(0) = atan2(AIK(2,1),AIK(2,2));
79  AlphaBetaGamma(2) = ArcTan(AIK(0,0),AIK(1,0));
80  } else {
81  AlphaBetaGamma(0)=0;
82  AlphaBetaGamma(2)=atan2(-AIK(0,1),AIK(1,1));
83  }
84  return AlphaBetaGamma;
85  }
86 
87  template<class Row>
89  return AIK2RevCardan(trans(AKI));
90  }
91 
92 
99 
104 
108  fmatvec::SqrMat Cardan2AIK(double alpha,double beta,double gamma);
109 
113  fmatvec::SqrMat Euler2AIK(double psi, double theta, double phi);
114 }
115 
116 #endif
Vec calcParametersDotZXY(const SqrMat &AIK, const Vec &KomegaK)
kinematic equations to calculate [al_dot; be_dot; ga_dot] from AIK and KomegaK
Definition: rotarymatrices.cc:133
Vec AIK2ParametersZXY(const SqrMat &AIK)
ZXY parametrisation (z -x -y) with parameters (angles) = [al; be; ga] first rotation: z-Axis (ga)...
Definition: rotarymatrices.cc:118
SqrMat Cardan2AIK(double alpha, double beta, double gamma)
Cardan parametrisation (x y z): calculate AIK matrix from angles (alpha, beta, gamma) ...
Definition: rotarymatrices.cc:88
SqrMat BasicRotAKIx(double phi)
Basic Rotations (see Script TM Grundlagenfach)
Definition: rotarymatrices.cc:40
double ArcTan(double x, double y)
calculates planar angle in [0,2] with respect to Cartesian coordinates of: Arc Tangent (y/x) ...
Definition: utils.cc:72
fmatvec::Vector< Row, double > AIK2Cardan(const fmatvec::SquareMatrix< Row, double > &AIK)
Cardan parametrisation (x y z): calculate angles (alpha, beta, gamma) from rotation matrix AKI or AIK...
Definition: rotarymatrices.h:50
fmatvec::Vector< Row, double > AIK2RevCardan(const fmatvec::SquareMatrix< Row, double > &AIK)
reversed Cardan parametrisation (z y x): calculate angles (alpha, beta, gamma) from rotation matrix A...
Definition: rotarymatrices.h:73
SqrMat Euler2AIK(double psi, double theta, double phi)
Euler parametrisation: calculate AIK matrix from angles (psi, theta, phi); psi: Preazession; theta: N...
Definition: rotarymatrices.cc:103

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML