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);
347 double operator()(
unsigned int idx)
const {
return mECLoc.Entry(idx); }
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;
544 return l.operator*(scalar);
This class implements a 3 element column vector.
static constexpr double radtodeg
FGJSBBase()
Constructor for FGJSBBase.
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF).
double GetCosLongitude() const
Get the cosine of Longitude.
double & operator()(unsigned int idx)
Write access the entries of the vector.
const FGMatrix33 & GetTec2l(void) const
Transform matrix from the earth centered to local horizontal frame.
FGLocation operator-(const FGLocation &l) const
This operator substracts two ECEF position vectors.
double GetGeodAltitude(void) const
Gets the geodetic altitude in feet.
bool operator!=(const FGLocation &l) const
This operator returns true if the ECEF location vectors for the two location objects are not equal.
FGLocation LocalToLocation(const FGColumnVector3 &lvec) const
Conversion from Local frame coordinates to a location in the earth centered and fixed frame.
void SetLongitude(double longitude)
Set the longitude.
const FGLocation & operator*=(double scalar)
This operator scales the ECEF position vector.
FGLocation operator*(double scalar) const
This operator scales an ECEF position vector.
const FGLocation & operator=(const FGColumnVector3 &v)
Sets this location via the supplied vector.
const FGLocation & operator-=(const FGLocation &l)
This operator substracts the ECEF position vectors.
double & Entry(unsigned int idx)
Write access the entries of the vector.
double GetLongitudeDeg() const
Get the longitude.
FGLocation(void)
Default constructor.
double GetRadius() const
Get the distance from the center of the earth in feet.
double operator()(unsigned int idx) const
Read access the entries of the vector.
const FGMatrix33 & GetTl2ec(void) const
Transform matrix from local horizontal to earth centered frame.
void SetPositionGeodetic(double lon, double lat, double height)
Sets the longitude, latitude and the distance above the reference spheroid.
const FGLocation & operator+=(const FGLocation &l)
This operator adds the ECEF position vectors.
double GetLongitude() const
Get the longitude.
double GetDistanceTo(double target_longitude, double target_latitude) const
Get the geodetic distance between the current location and a given location.
double Entry(unsigned int idx) const
Read access the entries of the vector.
FGColumnVector3 LocationToLocal(const FGColumnVector3 &ecvec) const
Conversion from a location in the earth centered and fixed frame to local horizontal frame coordinate...
double GetGeodLatitudeDeg(void) const
Get the GEODETIC latitude in degrees.
double GetLatitude() const
Get the GEOCENTRIC latitude in radians.
void SetRadius(double radius)
Set the distance from the center of the earth.
const FGLocation & operator/=(double scalar)
This operator scales the ECEF position vector.
double GetGeodLatitudeRad(void) const
Get the GEODETIC latitude in radians.
void SetPosition(double lon, double lat, double radius)
Sets the longitude, latitude and the distance from the center of the earth.
double GetSeaLevelRadius(void) const
Get the sea level radius in feet below the current location.
void SetLatitude(double latitude)
Set the GEOCENTRIC latitude.
bool operator==(const FGLocation &l) const
This operator returns true if the ECEF location vectors for the two location objects are equal.
void SetEllipse(double semimajor, double semiminor)
Sets the semimajor and semiminor axis lengths for this planet.
FGLocation operator+(const FGLocation &l) const
This operator adds two ECEF position vectors.
double GetSinLongitude() const
Get the sine of Longitude.
double GetLatitudeDeg() const
Get the GEOCENTRIC latitude in degrees.
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...
Handles matrix math operations.
FGColumnVector3 operator*(double scalar, const FGColumnVector3 &A)
Scalar multiplication.