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
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#ifdef FGFS
-# include <simgear/compiler.h>
-# ifdef SG_HAVE_STD_INCLUDES
-# include <vector>
-# else
-# include <vector.h>
-# endif
-#else
-# include <vector>
-#endif
+#include <vector>
#include "FGModel.h"
-#include <math/FGColumnVector3.h>
+#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
CLASS DOCUMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-/** Models inertial forces (e.g. centripetal and coriolis accelerations).
+/** Models inertial forces (e.g. centripetal and coriolis accelerations). Starting
+ conversion to WGS84.
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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);
};
}