]> git.mxchange.org Git - flightgear.git/blob - JSBsim/FGTranslation.h
New changes to address various feedback from initial release.
[flightgear.git] / JSBsim / FGTranslation.h
1 /*******************************************************************************
2
3  Header:       FGTranslation.h
4  Author:       Jon Berndt
5  Date started: 12/02/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/02/98   JSB   Created
29
30 ********************************************************************************
31 COMMENTS, REFERENCES,  and NOTES
32 ********************************************************************************
33 [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
34     Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420  Naval Postgraduate
35     School, January 1994
36 [2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
37     JSC 12960, July 1977
38 [3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
39     NASA-Ames", NASA CR-2497, January 1975
40 [4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
41     Wiley & Sons, 1979 ISBN 0-471-03032-5
42 [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
43     1982 ISBN 0-471-08936-2
44
45   The order of rotations used in this class corresponds to a 3-2-1 sequence,
46   or Y-P-R, or Z-Y-X, if you prefer.
47
48 ********************************************************************************
49 SENTRY
50 *******************************************************************************/
51
52 #ifndef FGTRANSLATION_H
53 #define FGTRANSLATION_H
54
55 /*******************************************************************************
56 INCLUDES
57 *******************************************************************************/
58
59 #include <math.h>
60 #include "FGModel.h"
61
62 /*******************************************************************************
63 CLASS DECLARATION
64 *******************************************************************************/
65
66 class FGTranslation : public FGModel
67 {
68 public:
69    FGTranslation(FGFDMExec*);
70    ~FGTranslation(void);
71
72    inline float GetU(void) {return U;}
73    inline float GetV(void) {return V;}
74    inline float GetW(void) {return W;}
75
76    inline float GetUdot(void) {return Udot;}
77    inline float GetVdot(void) {return Vdot;}
78    inline float GetWdot(void) {return Wdot;}
79
80    inline float Getalpha(void) {return alpha;}
81    inline float Getbeta (void) {return beta; }
82    inline float Getgamma(void) {return gamma;}
83
84    inline void SetU(float tt) {U = tt;}
85    inline void SetV(float tt) {V = tt;}
86    inline void SetW(float tt) {W = tt;}
87
88    inline void SetUVW(float t1, float t2, float t3) {U=t1; V=t2; W=t3;}
89
90    inline void Setalpha(float tt) {alpha = tt;}
91    inline void Setbeta (float tt) {beta  = tt;}
92    inline void Setgamma(float tt) {gamma = tt;}
93
94    inline void SetABG(float t1, float t2, float t3) {alpha=t1; beta=t2; gamma=t3;}
95
96    bool Run(void);
97
98 protected:
99
100 private:
101   float U, V, W;                 // Body frame velocities owned by FGTranslation
102   float P, Q, R;
103   float Vt, qbar;
104   float Udot, Vdot, Wdot;
105   float lastUdot, lastVdot, lastWdot;
106   float phi, tht, psi;
107   float Fx, Fy, Fz;
108   float Mass, dt;
109   float alpha, beta, gamma;
110   float rho;
111
112   void GetState(void);
113   void PutState(void);
114 };
115
116 /******************************************************************************/
117 #endif