mbsim  4.0.0
MBSim Kernel
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
24#include "fmatvec/fmatvec.h"
25
26namespace MBSim {
27
35 fmatvec::SqrMat3 BasicRotAKIx(double phi);
36 fmatvec::SqrMat3 BasicRotAKIy(double phi);
37 fmatvec::SqrMat3 BasicRotAKIz(double phi);
38
39 /*
40 * \brief Rotate CoSy K (angle phi) to obtain CoSy I
41 */
42 inline fmatvec::SqrMat3 BasicRotAIKx(double phi) { return BasicRotAKIx(-phi); }
43 inline fmatvec::SqrMat3 BasicRotAIKy(double phi) { return BasicRotAKIy(-phi); }
44 inline fmatvec::SqrMat3 BasicRotAIKz(double phi) { return BasicRotAKIz(-phi); }
45
49 fmatvec::Vec3 AIK2Cardan(const fmatvec::SqrMat3 &AIK);
50
51 inline fmatvec::Vec3 AKI2Cardan(const fmatvec::SqrMat3 &AKI) { return AIK2Cardan(AKI.T()); }
52
56 fmatvec::Vec3 AIK2RevCardan(const fmatvec::SqrMat3 &AIK);
57
58 inline fmatvec::Vec3 AKI2RevCardan(const fmatvec::SqrMat3 &AKI) { return AIK2RevCardan(AKI.T()); }
59
65 fmatvec::Vec3 AIK2ParametersZXY(const fmatvec::SqrMat3 &AIK);
66
70 fmatvec::Vec3 calcParametersDotZXY(const fmatvec::SqrMat3 &AIK, const fmatvec::Vec3 &KomegaK);
71
75 inline fmatvec::SqrMat3 Cardan2AIK(double alpha,double beta,double gamma) { return BasicRotAIKx(alpha)*BasicRotAIKy(beta)*BasicRotAIKz(gamma); }
76
80 inline fmatvec::SqrMat3 Euler2AIK(double psi, double theta, double phi) { return BasicRotAIKz(psi)*BasicRotAIKx(theta)*BasicRotAIKz(phi); }
81
85 fmatvec::SqrMat3 RotationAboutAxis(const fmatvec::Vec3 &a, double phi);
86
90 fmatvec::Vec3 AIK2Phi(const fmatvec::SqrMat3 &AIK);
91
92}
93
94#endif
namespace MBSim
Definition: bilateral_constraint.cc:30
SqrMat3 BasicRotAKIx(double phi)
Basic Rotations (see Script TM Grundlagenfach)
Definition: rotarymatrices.cc:40
fmatvec::SqrMat3 Cardan2AIK(double alpha, double beta, double gamma)
Cardan parametrisation (x y z): calculate AIK matrix from angles (alpha, beta, gamma)
Definition: rotarymatrices.h:75
fmatvec::SqrMat3 Euler2AIK(double psi, double theta, double phi)
Euler parametrisation: calculate AIK matrix from angles (psi, theta, phi); psi: Preazession; theta: N...
Definition: rotarymatrices.h:80
fmatvec::Vec3 AIK2Phi(const fmatvec::SqrMat3 &AIK)
calculate angles (alpha, beta, gamma) from rotation matrix AIK assuming small rotation
Definition: rotarymatrices.cc:168