 |
JSBSim Flight Dynamics Model
1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
|
47 #include "FGJSBBase.h"
48 #include "FGColumnVector3.h"
49 #include "FGMatrix33.h"
53 #error Usage of -ffast-math is strongly discouraged
162 FGLocation(
double lon,
double lat,
double radius);
215 void SetPosition(
double lon,
double lat,
double radius);
228 void SetEllipse(
double semimajor,
double semiminor);
260 ComputeDerived();
return mGeodLat;
275 ComputeDerived();
return radtodeg*mGeodLat;
281 ComputeDerived();
return GeodeticAltitude;
291 double GetRadius()
const { ComputeDerived();
return mRadius; }
309 double GetDistanceTo(
double target_longitude,
double target_latitude)
const;
318 double GetHeadingTo(
double target_longitude,
double target_latitude)
const;
327 ComputeDerived();
return mTl2ec*lvec + mECLoc;
337 ComputeDerived();
return mTec2l*(ecvec - mECLoc);
354 double&
operator()(
unsigned int idx) { mCacheValid =
false;
return mECLoc.
Entry(idx); }
364 double Entry(
unsigned int idx)
const {
return mECLoc.
Entry(idx); }
375 mCacheValid =
false;
return mECLoc.
Entry(idx);
402 return mECLoc == l.mECLoc;
484 void ComputeDerivedUnconditional(
void)
const;
490 void ComputeDerived(
void)
const {
492 ComputeDerivedUnconditional();
504 FGColumnVector3 mECLoc;
509 mutable double mRadius;
510 mutable double mGeodLat;
511 mutable double GeodeticAltitude;
514 mutable FGMatrix33 mTl2ec;
515 mutable FGMatrix33 mTec2l;
530 mutable bool mCacheValid;
533 bool mEllipseSet =
false;
542 inline FGLocation operator*(
double scalar,
const FGLocation& l)
544 return l.operator*(scalar);
double GetLongitudeDeg() const
Get the longitude.
FGLocation LocalToLocation(const FGColumnVector3 &lvec) const
Conversion from Local frame coordinates to a location in the earth centered and fixed frame.
double GetLatitudeDeg() const
Get the GEOCENTRIC latitude in degrees.
This class implements a 3 element column vector.
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF).
double GetDistanceTo(double target_longitude, double target_latitude) const
Get the geodetic distance between the current location and a given location.
void SetRadius(double radius)
Set the distance from the center of the earth.
const FGMatrix33 & GetTec2l(void) const
Transform matrix from the earth centered to local horizontal frame.
double GetLongitude() const
Get the longitude.
const FGLocation & operator+=(const FGLocation &l)
This operator adds the ECEF position vectors.
bool operator==(const FGLocation &l) const
This operator returns true if the ECEF location vectors for the two location objects are equal.
double operator()(unsigned int idx) const
Read access the entries of the vector.
double GetCosLongitude() const
Get the cosine of Longitude.
const FGLocation & operator=(const FGColumnVector3 &v)
Sets this location via the supplied vector.
double GetGeodLatitudeRad(void) const
Get the GEODETIC latitude in radians.
double GetGeodLatitudeDeg(void) const
Get the GEODETIC latitude in degrees.
double GetRadius() const
Get the distance from the center of the earth in feet.
FGLocation operator+(const FGLocation &l) const
This operator adds two ECEF position vectors.
double GetLatitude() const
Get the GEOCENTRIC latitude in radians.
Handles matrix math operations.
void SetPositionGeodetic(double lon, double lat, double height)
Sets the longitude, latitude and the distance above the reference spheroid.
const FGMatrix33 & GetTl2ec(void) const
Transform matrix from local horizontal to earth centered frame.
FGColumnVector3 LocationToLocal(const FGColumnVector3 &ecvec) const
Conversion from a location in the earth centered and fixed frame to local horizontal frame coordinate...
const FGLocation & operator/=(double scalar)
This operator scales the ECEF position vector.
void SetLongitude(double longitude)
Set the longitude.
void SetLatitude(double latitude)
Set the GEOCENTRIC latitude.
void SetEllipse(double semimajor, double semiminor)
Sets the semimajor and semiminor axis lengths for this planet.
void SetPosition(double lon, double lat, double radius)
Sets the longitude, latitude and the distance from the center of the earth.
double & Entry(unsigned int idx)
Write access the entries of the vector.
bool operator!=(const FGLocation &l) const
This operator returns true if the ECEF location vectors for the two location objects are not equal.
double GetGeodAltitude(void) const
Gets the geodetic altitude in feet.
double GetSeaLevelRadius(void) const
Get the sea level radius in feet below the current location.
double Entry(const unsigned int idx) const
Read access the entries of the vector.
FGLocation(void)
Default constructor.
const FGLocation & operator-=(const FGLocation &l)
This operator substracts the ECEF position vectors.
FGLocation operator*(double scalar) const
This operator scales an ECEF position vector.
const FGLocation & operator*=(double scalar)
This operator scales the ECEF position vector.
double Entry(unsigned int idx) const
Read access the entries of the vector.
double & operator()(unsigned int idx)
Write access the entries of the vector.
FGLocation operator-(const FGLocation &l) const
This operator substracts two ECEF position vectors.
double GetHeadingTo(double target_longitude, double target_latitude) const
Get the heading that should be followed from the current location to a given location along the short...
double GetSinLongitude() const
Get the sine of Longitude.