X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGInertial.h;h=f4db378a2dc24da6060f7a18a416450a2ba3032e;hb=4f364af6d178d947eae1a5a751e3a9542b270069;hp=72c7864c17dfb45b96b29552b0d449b6d2b349d7;hpb=3ec74d79c23347add2afa088b05ad29af975f65f;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGInertial.h b/src/FDM/JSBSim/models/FGInertial.h index 72c7864c1..f4db378a2 100644 --- a/src/FDM/JSBSim/models/FGInertial.h +++ b/src/FDM/JSBSim/models/FGInertial.h @@ -4,7 +4,7 @@ Author: Jon S. Berndt Date started: 09/13/00 - ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) ------------- + ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) ------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software @@ -38,25 +38,16 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#ifdef FGFS -# include -# ifdef SG_HAVE_STD_INCLUDES -# include -# else -# include -# endif -#else -# include -#endif +#include #include "FGModel.h" -#include +#include "math/FGColumnVector3.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_INERTIAL "$Id$" +#define ID_INERTIAL "$Id: FGInertial.h,v 1.15 2010/01/27 04:01:09 jberndt Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -68,7 +59,8 @@ namespace JSBSim { CLASS DOCUMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -/** Models inertial forces (e.g. centripetal and coriolis accelerations). +/** Models inertial forces (e.g. centripetal and coriolis accelerations). Starting + conversion to WGS84. */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -81,19 +73,35 @@ public: FGInertial(FGFDMExec*); ~FGInertial(void); + bool InitModel(void); + bool Run(void); double SLgravity(void) const {return gAccelReference;} double gravity(void) const {return gAccel;} double omega(void) const {return RotationRate;} - double GetGAccel(double r) const { return GM/(r*r); } - double RefRadius(void) const {return RadiusReference;} + double GetEarthPositionAngle(void) const { return earthPosAngle; } + double GetEarthPositionAngleDeg(void) const { return earthPosAngle*radtodeg;} + double GetGAccel(double r) const; + FGColumnVector3 GetGravityJ2(FGColumnVector3 position) const; + double GetRefRadius(void) const {return RadiusReference;} + double GetSemimajor(void) const {return a;} + double GetSemiminor(void) const {return b;} + + void SetEarthPositionAngle(double epa) {earthPosAngle = epa;} private: double gAccel; double gAccelReference; double RadiusReference; double RotationRate; + double earthPosAngle; double GM; + double C2_0; // WGS84 value for the C2,0 coefficient + double J2; // WGS84 value for J2 + double a; // WGS84 semimajor axis length in feet + double b; // WGS84 semiminor axis length in feet + + void bind(void); void Debug(int from); }; }