JSBSim Flight Dynamics Model
1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
|
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF). More...
#include <FGLocation.h>
Public Member Functions | |
FGLocation (void) | |
Default constructor. More... | |
FGLocation (double lon, double lat, double radius) | |
Constructor to set the longitude, latitude and the distance from the center of the earth. More... | |
FGLocation (const FGColumnVector3 &lv) | |
Constructor to initialize the location with the cartesian coordinates (X,Y,Z) contained in the input FGColumnVector3. More... | |
FGLocation (const FGLocation &l) | |
Copy constructor. More... | |
double | Entry (unsigned int idx) const |
Read access the entries of the vector. More... | |
double & | Entry (unsigned int idx) |
Write access the entries of the vector. More... | |
double | GetCosLatitude () const |
Get the cosine of Latitude. More... | |
double | GetCosLongitude () const |
Get the cosine of Longitude. More... | |
double | GetDistanceTo (double target_longitude, double target_latitude) const |
Get the geodetic distance between the current location and a given location. More... | |
double | GetEPA () const |
Return the Earth Position Angle. More... | |
double | GetGeodAltitude (void) const |
Gets the geodetic altitude in feet. More... | |
double | GetGeodLatitudeDeg (void) const |
Get the geodetic latitude in degrees. More... | |
double | GetGeodLatitudeRad (void) const |
Get the geodetic latitude. More... | |
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 shortest path. More... | |
double | GetLatitude () const |
Get the latitude. More... | |
double | GetLatitudeDeg () const |
Get the latitude. More... | |
double | GetLongitude () const |
Get the longitude. More... | |
double | GetLongitudeDeg () const |
Get the longitude. More... | |
double | GetRadius () const |
Get the distance from the center of the earth. More... | |
double | GetSinLatitude () const |
Get the sine of Latitude. More... | |
double | GetSinLongitude () const |
Get the sine of Longitude. More... | |
double | GetTanLatitude () const |
Get the cosine of Latitude. More... | |
const FGMatrix33 & | GetTec2i (void) const |
Transform matrix from the earth centered to inertial frame. More... | |
const FGMatrix33 & | GetTec2l (void) const |
Transform matrix from the earth centered to local horizontal frame. More... | |
const FGMatrix33 & | GetTi2ec (void) const |
Transform matrix from inertial to earth centered frame. More... | |
const FGMatrix33 & | GetTi2l (void) const |
Transform matrix from the inertial to local horizontal frame. More... | |
const FGMatrix33 & | GetTl2ec (void) const |
Transform matrix from local horizontal to earth centered frame. More... | |
const FGMatrix33 & | GetTl2i (void) const |
Transform matrix from local horizontal to inertial frame. More... | |
void | IncrementEarthPositionAngle (double delta) |
Increments the Earth position angle. More... | |
FGLocation | LocalToLocation (const FGColumnVector3 &lvec) const |
Conversion from Local frame coordinates to a location in the earth centered and fixed frame. More... | |
FGColumnVector3 | LocationToLocal (const FGColumnVector3 &ecvec) const |
Conversion from a location in the earth centered and fixed frame to local horizontal frame coordinates. More... | |
operator const FGColumnVector3 & () const | |
Cast to a simple 3d vector. | |
bool | operator!= (const FGLocation &l) const |
This operator returns true if the ECEF location vectors for the two location objects are not equal. More... | |
double | operator() (unsigned int idx) const |
Read access the entries of the vector. More... | |
double & | operator() (unsigned int idx) |
Write access the entries of the vector. More... | |
FGLocation | operator* (double scalar) const |
This operator scales an ECEF position vector. More... | |
const FGLocation & | operator*= (double scalar) |
This operator scales the ECEF position vector. More... | |
FGLocation | operator+ (const FGLocation &l) const |
This operator adds two ECEF position vectors. More... | |
const FGLocation & | operator+= (const FGLocation &l) |
This operator adds the ECEF position vectors. More... | |
FGLocation | operator- (const FGLocation &l) const |
This operator substracts two ECEF position vectors. More... | |
const FGLocation & | operator-= (const FGLocation &l) |
This operator substracts the ECEF position vectors. More... | |
const FGLocation & | operator/= (double scalar) |
This operator scales the ECEF position vector. More... | |
const FGLocation & | operator= (const FGColumnVector3 &v) |
Sets this location via the supplied vector. More... | |
const FGLocation & | operator= (const FGLocation &l) |
Sets this location via the supplied location object. More... | |
bool | operator== (const FGLocation &l) const |
This operator returns true if the ECEF location vectors for the two location objects are equal. More... | |
void | SetEarthPositionAngle (double EPA) |
Sets the Earth position angle. More... | |
void | SetEllipse (double semimajor, double semiminor) |
Sets the semimajor and semiminor axis lengths for this planet. More... | |
void | SetLatitude (double latitude) |
Set the latitude. More... | |
void | SetLongitude (double longitude) |
Set the longitude. More... | |
void | SetPosition (double lon, double lat, double radius) |
Sets the longitude, latitude and the distance from the center of the earth. More... | |
void | SetPositionGeodetic (double lon, double lat, double height) |
Sets the longitude, latitude and the distance above the reference ellipsoid. More... | |
void | SetRadius (double radius) |
Set the distance from the center of the earth. More... | |
Functions that rely on the ground callback | |
The following functions allow to set and get the vehicle position above the sea or the ground. The sea and the ground levels are obtained by interrogating an FGGroundCallback instance. A ground callback must therefore be set with SetGroundCallback() before calling any of these functions. | |
void | SetAltitudeASL (double altitudeASL) |
Set the altitude above sea level. More... | |
void | SetAltitudeAGL (double altitudeAGL) |
Set the altitude above ground level. More... | |
double | GetSeaLevelRadius (void) const |
Get the local sea level radius. More... | |
double | GetTerrainRadius (void) const |
Get the local terrain radius. More... | |
double | GetAltitudeASL (void) const |
Get the altitude above sea level. More... | |
double | GetAltitudeAGL (void) const |
Get the altitude above ground level. More... | |
double | GetContactPoint (FGLocation &contact, FGColumnVector3 &normal, FGColumnVector3 &v, FGColumnVector3 &w) const |
Get terrain contact point information below the current location. More... | |
Public Member Functions inherited from FGJSBBase | |
FGJSBBase () | |
Constructor for FGJSBBase. | |
virtual | ~FGJSBBase () |
Destructor for FGJSBBase. | |
void | disableHighLighting (void) |
Disables highlighting in the console output. | |
std::string | GetVersion (void) |
Returns the version number of JSBSim. More... | |
void | PutMessage (const Message &msg) |
Places a Message structure on the Message queue. More... | |
void | PutMessage (const std::string &text) |
Creates a message with the given text and places it on the queue. More... | |
void | PutMessage (const std::string &text, bool bVal) |
Creates a message with the given text and boolean value and places it on the queue. More... | |
void | PutMessage (const std::string &text, int iVal) |
Creates a message with the given text and integer value and places it on the queue. More... | |
void | PutMessage (const std::string &text, double dVal) |
Creates a message with the given text and double value and places it on the queue. More... | |
int | SomeMessages (void) |
Reads the message on the queue (but does not delete it). More... | |
void | ProcessMessage (void) |
Reads the message on the queue and removes it from the queue. More... | |
Message * | ProcessNextMessage (void) |
Reads the next message on the queue and removes it from the queue. More... | |
Static Public Member Functions | |
static FGGroundCallback * | GetGroundCallback (void) |
Get a pointer to the ground callback currently used. More... | |
static void | SetGroundCallback (FGGroundCallback *gc) |
Sets the ground callback pointer. More... | |
Static Public Member Functions inherited from FGJSBBase | |
static double | CelsiusToFahrenheit (double celsius) |
Converts from degrees Celsius to degrees Fahrenheit. More... | |
static double | CelsiusToKelvin (double celsius) |
Converts from degrees Celsius to degrees Kelvin. More... | |
static double | CelsiusToRankine (double celsius) |
Converts from degrees Celsius to degrees Rankine. More... | |
static double | Constrain (double min, double value, double max) |
Constrain a value between a minimum and a maximum value. | |
static bool | EqualToRoundoff (double a, double b) |
Finite precision comparison. More... | |
static bool | EqualToRoundoff (float a, float b) |
Finite precision comparison. More... | |
static bool | EqualToRoundoff (float a, double b) |
Finite precision comparison. More... | |
static bool | EqualToRoundoff (double a, float b) |
Finite precision comparison. More... | |
static double | FahrenheitToCelsius (double fahrenheit) |
Converts from degrees Fahrenheit to degrees Celsius. More... | |
static double | FeetToMeters (double measure) |
Converts from feet to meters. More... | |
static double | GaussianRandomNumber (void) |
static double | KelvinToCelsius (double kelvin) |
Converts from degrees Kelvin to degrees Celsius. More... | |
static double | KelvinToFahrenheit (double kelvin) |
Converts from degrees Kelvin to degrees Fahrenheit. More... | |
static double | KelvinToRankine (double kelvin) |
Converts from degrees Kelvin to degrees Rankine. More... | |
static double | MachFromVcalibrated (double vcas, double p, double psl, double rhosl) |
Calculate the Mach number from the calibrated airspeed. More... | |
static double | PitotTotalPressure (double mach, double p) |
Compute the total pressure in front of the Pitot tube. More... | |
static double | RankineToCelsius (double rankine) |
Converts from degrees Rankine to degrees Celsius. More... | |
static double | RankineToKelvin (double rankine) |
Converts from degrees Rankine to degrees Kelvin. More... | |
static double | sign (double num) |
static double | VcalibratedFromMach (double mach, double p, double psl, double rhosl) |
Calculate the calibrated airspeed from the Mach number. More... | |
Additional Inherited Members | |
Public Types inherited from FGJSBBase | |
enum | { eL = 1, eM, eN } |
Moments L, M, N. | |
enum | { eP = 1, eQ, eR } |
Rates P, Q, R. | |
enum | { eU = 1, eV, eW } |
Velocities U, V, W. | |
enum | { eX = 1, eY, eZ } |
Positions X, Y, Z. | |
enum | { ePhi = 1, eTht, ePsi } |
Euler angles Phi, Theta, Psi. | |
enum | { eDrag = 1, eSide, eLift } |
Stability axis forces, Drag, Side force, Lift. | |
enum | { eRoll = 1, ePitch, eYaw } |
Local frame orientation Roll, Pitch, Yaw. | |
enum | { eNorth = 1, eEast, eDown } |
Local frame position North, East, Down. | |
enum | { eLat = 1, eLong, eRad } |
Locations Radius, Latitude, Longitude. | |
enum | { inNone = 0, inDegrees, inRadians, inMeters, inFeet } |
Conversion specifiers. | |
Static Public Attributes inherited from FGJSBBase | |
static short | debug_lvl = 1 |
static char | highint [5] = {27, '[', '1', 'm', '\0' } |
highlights text | |
static char | halfint [5] = {27, '[', '2', 'm', '\0' } |
low intensity text | |
static char | normint [6] = {27, '[', '2', '2', 'm', '\0' } |
normal intensity text | |
static char | reset [5] = {27, '[', '0', 'm', '\0' } |
resets text properties | |
static char | underon [5] = {27, '[', '4', 'm', '\0' } |
underlines text | |
static char | underoff [6] = {27, '[', '2', '4', 'm', '\0' } |
underline off | |
static char | fgblue [6] = {27, '[', '3', '4', 'm', '\0' } |
blue text | |
static char | fgcyan [6] = {27, '[', '3', '6', 'm', '\0' } |
cyan text | |
static char | fgred [6] = {27, '[', '3', '1', 'm', '\0' } |
red text | |
static char | fggreen [6] = {27, '[', '3', '2', 'm', '\0' } |
green text | |
static char | fgdef [6] = {27, '[', '3', '9', 'm', '\0' } |
default text | |
Protected Member Functions inherited from FGJSBBase | |
void | Debug (int) |
Static Protected Member Functions inherited from FGJSBBase | |
static std::string | CreateIndexedPropertyName (const std::string &Property, int index) |
Static Protected Attributes inherited from FGJSBBase | |
static const double | degtorad = 0.017453292519943295769236907684886 |
static const double | fpstokts = 1.0/ktstofps |
static const double | fttom = 0.3048 |
static int | gaussian_random_number_phase = 0 |
static const double | hptoftlbssec = 550.0 |
static const double | in3tom3 = 1.638706E-5 |
static const double | inchtoft = 0.08333333 |
static const double | inhgtopa = 3386.38 |
static const std::string | JSBSim_version = "1.0 " __DATE__ " " __TIME__ |
static const double | kgtolb = 2.20462 |
static const double | kgtoslug = 0.06852168 |
static const double | ktstofps = 1.68781 |
static const double | lbtoslug = 1.0/slugtolb |
static Message | localMsg |
static const double | m3toft3 = 1.0/(fttom*fttom*fttom) |
static double | Mair = 28.9645 |
static unsigned int | messageId = 0 |
static std::queue< Message > | Messages |
static const std::string | needed_cfg_version = "2.0" |
static const double | psftoinhg = 0.014138 |
static const double | psftopa = 47.88 |
static const double | radtodeg = 57.295779513082320876798154814105 |
static double | Reng = 1716.56 |
static double | Rstar = 1545.348 |
static const double | SHRatio = 1.40 |
static const double | slugtolb = 32.174049 |
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF).
The coordinate frame ECEF has its center in the middle of the earth. The X-axis points from the center of the Earth towards a location with zero latitude and longitude on the Earth surface. The Y-axis points from the center of the Earth towards a location with zero latitude and 90 deg East longitude on the Earth surface. The Z-axis points from the Earth center to the geographic north pole.
This class provides access functions to set and get the location as either the simple X, Y and Z values in ft or longitude/latitude and the radial distance of the location from the Earth center.
It is common to associate a parent frame with a location. This frame is usually called the local horizontal frame or simply the local frame. It is also called the NED frame (North, East, Down), as well as the Navigation frame. This frame has its X/Y plane parallel to the surface of the Earth (with the assumption of a spherical Earth). The X-axis points towards north, the Y-axis points east and the Z-axis points to the center of the Earth.
Since the local frame is determined by the location (and NOT by the orientation of the vehicle IN any frame), this class also provides the rotation matrices required to transform from the Earth centered (ECEF) frame to the local horizontal frame and back. This class also "owns" the transformations that go from the inertial frame (Earth-centered Inertial, or ECI) to and from the ECEF frame, as well as to and from the local frame. Again, this is because the ECI, ECEF, and local frames do not involve the actual orientation of the vehicle - only the location on the Earth surface, and the angular difference between the ECI and ECEF frames. There are conversion functions for conversion of position vectors given in the one frame to positions in the other frame.
To keep the transformation matrices between the ECI and ECEF frames up to date, the Earth angular position must be updated by calling SetEarthPositionAngle() or IncrementEarthPositionAngle(). This must be done prior to any conversion from and to the ECI frame.
The Earth centered reference frame is NOT an inertial frame since it rotates with the Earth.
The cartesian coordinates (X,Y,Z) in the Earth centered frame are the master values. All other values are computed from these master values and are cached as long as the location is changed by access through a non-const member function. Values are cached to improve performance. It is best practice to work with a natural set of master values. Other parameters that are derived from these master values are calculated only when needed, and IF they are needed and calculated, then they are cached (stored and remembered) so they do not need to be re-calculated until the master values they are derived from are themselves changed (and become stale).
Accuracy and round off
Given,
we have an accuracy of about
1e-16*2e7ft/1 = 2e-9 ft
left. This should be sufficient for our needs. Note that this is the same relative accuracy we would have when we compute directly with lon/lat/radius. For the radius value this is clear. For the lon/lat pair this is easy to see. Take for example KSFO located at about 37.61 deg north 122.35 deg west, which corresponds to 0.65642 rad north and 2.13541 rad west. Both values are of magnitude of about 1. But 1 ft corresponds to about 1/(2e7*2*pi) = 7.9577e-09 rad. So the left accuracy with this representation is also about 1*1e-16/7.9577e-09 = 1.2566e-08 which is of the same magnitude as the representation chosen here.
The advantage of this representation is that it is a linear space without singularities. The singularities are the north and south pole and most notably the non-steady jump at -pi to pi. It is harder to track this jump correctly especially when we need to work with error norms and derivatives of the equations of motion within the time-stepping code. Also, the rate of change is of the same magnitude for all components in this representation which is an advantage for numerical stability in implicit time-stepping.
Note: The latitude is a GEOCENTRIC value. FlightGear converts latitude to a geodetic value and uses that. In order to get best matching relative to a map, geocentric latitude must be converted to geodetic.
Definition at line 160 of file FGLocation.h.
FGLocation | ( | void | ) |
Default constructor.
Definition at line 60 of file FGLocation.cpp.
FGLocation | ( | double | lon, |
double | lat, | ||
double | radius | ||
) |
Constructor to set the longitude, latitude and the distance from the center of the earth.
lon | longitude |
lat | GEOCENTRIC latitude |
radius | distance from center of earth to vehicle in feet |
Definition at line 80 of file FGLocation.cpp.
FGLocation | ( | const FGColumnVector3 & | lv | ) |
Constructor to initialize the location with the cartesian coordinates (X,Y,Z) contained in the input FGColumnVector3.
Distances are in feet, the position is expressed in the ECEF frame.
lv | vector that contain the cartesian coordinates |
Definition at line 108 of file FGLocation.cpp.
FGLocation | ( | const FGLocation & | l | ) |
|
inline |
Read access the entries of the vector.
idx | the component index. |
double operator()(unsigned int idx) const
function. It is used internally to access the elements in a more convenient way. Note that the index given in the argument is unchecked. Definition at line 505 of file FGLocation.h.
|
inline |
Write access the entries of the vector.
idx | the component index. |
Definition at line 515 of file FGLocation.h.
|
inline |
Get the altitude above ground level.
Definition at line 365 of file FGLocation.h.
|
inline |
Get the altitude above sea level.
Definition at line 359 of file FGLocation.h.
|
inline |
Get terrain contact point information below the current location.
contact | Contact point location |
normal | Terrain normal vector in contact point (ECEF frame) |
v | Terrain linear velocity in contact point (ECEF frame) |
w | Terrain angular velocity in contact point (ECEF frame) |
Definition at line 378 of file FGLocation.h.
|
inline |
Get the cosine of Latitude.
Definition at line 299 of file FGLocation.h.
|
inline |
Get the cosine of Longitude.
Definition at line 266 of file FGLocation.h.
double GetDistanceTo | ( | double | target_longitude, |
double | target_latitude | ||
) | const |
Get the geodetic distance between the current location and a given location.
This corresponds to the shortest distance between the two locations. Earth curvature is taken into account.
target_longitude | the target longitude |
target_latitude | the target latitude |
Definition at line 418 of file FGLocation.cpp.
|
inline |
Return the Earth Position Angle.
This is the relative orientation of the ECEF frame with respect to the Inertial frame.
Definition at line 316 of file FGLocation.h.
|
inline |
Gets the geodetic altitude in feet.
Definition at line 293 of file FGLocation.h.
|
inline |
Get the geodetic latitude in degrees.
Definition at line 290 of file FGLocation.h.
|
inline |
Get the geodetic latitude.
Definition at line 278 of file FGLocation.h.
|
inlinestatic |
Get a pointer to the ground callback currently used.
Since the FGGroundcallback instance might have been created outside JSBSim, it is recommanded to store the returned pointer in a 'smart pointer' FGGroundCallback_ptr. This pointer maintains a reference counter and protects the returned pointer against an accidental deletion of the object it is pointing to.
Definition at line 404 of file FGLocation.h.
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 shortest path.
Earth curvature is taken into account.
target_longitude | the target longitude |
target_latitude | the target latitude |
Definition at line 447 of file FGLocation.cpp.
|
inline |
Get the latitude.
Definition at line 272 of file FGLocation.h.
|
inline |
Get the latitude.
Definition at line 284 of file FGLocation.h.
|
inline |
Get the longitude.
Definition at line 254 of file FGLocation.h.
|
inline |
Get the longitude.
Definition at line 260 of file FGLocation.h.
|
inline |
Get the distance from the center of the earth.
Definition at line 323 of file FGLocation.h.
|
inline |
Get the local sea level radius.
Definition at line 347 of file FGLocation.h.
|
inline |
Get the sine of Latitude.
Definition at line 296 of file FGLocation.h.
|
inline |
Get the sine of Longitude.
Definition at line 263 of file FGLocation.h.
|
inline |
Get the cosine of Latitude.
Definition at line 302 of file FGLocation.h.
|
inline |
Transform matrix from the earth centered to inertial frame.
Definition at line 428 of file FGLocation.h.
|
inline |
Transform matrix from the earth centered to local horizontal frame.
Definition at line 414 of file FGLocation.h.
|
inline |
Get the local terrain radius.
Definition at line 353 of file FGLocation.h.
|
inline |
Transform matrix from inertial to earth centered frame.
Definition at line 421 of file FGLocation.h.
|
inline |
Transform matrix from the inertial to local horizontal frame.
Definition at line 435 of file FGLocation.h.
|
inline |
Transform matrix from local horizontal to earth centered frame.
Definition at line 409 of file FGLocation.h.
|
inline |
Transform matrix from local horizontal to inertial frame.
Definition at line 442 of file FGLocation.h.
|
inline |
Increments the Earth position angle.
This is the relative orientation of the ECEF frame with respect to the Inertial frame.
delta | delta to the Earth fixed frame (ECEF) rotation offset about the axis with respect to the Inertial (ECI) frame in radians. |
Definition at line 248 of file FGLocation.h.
|
inline |
Conversion from Local frame coordinates to a location in the earth centered and fixed frame.
This function calculates the FGLocation of an object which position relative to the vehicle is given as in input.
lvec | Vector in the local horizontal coordinate frame |
Definition at line 467 of file FGLocation.h.
|
inline |
Conversion from a location in the earth centered and fixed frame to local horizontal frame coordinates.
This function calculates the relative position between the vehicle and the input vector and returns the result expressed in the local frame.
ecvec | Vector in the earth centered and fixed frame |
Definition at line 477 of file FGLocation.h.
|
inline |
This operator returns true if the ECEF location vectors for the two location objects are not equal.
Definition at line 548 of file FGLocation.h.
|
inline |
Read access the entries of the vector.
idx | the component index. Return the value of the matrix entry at the given index. Indices are counted starting with 1. Note that the index given in the argument is unchecked. |
Definition at line 488 of file FGLocation.h.
|
inline |
Write access the entries of the vector.
idx | the component index. |
Definition at line 495 of file FGLocation.h.
|
inline |
This operator scales an ECEF position vector.
A new object is returned that defines a position made of the cartesian coordinates of the provided ECEF position scaled by the supplied scalar value.
Definition at line 606 of file FGLocation.h.
|
inline |
This operator scales the ECEF position vector.
The cartesian coordinates of the ECEF position vector on the left side of the equality are scaled by the supplied value (right side), and a reference to this object is returned.
Definition at line 574 of file FGLocation.h.
|
inline |
This operator adds two ECEF position vectors.
A new object is returned that defines a position which is the sum of the cartesian coordinates of the two positions provided.
Definition at line 591 of file FGLocation.h.
|
inline |
This operator adds the ECEF position vectors.
The cartesian coordinates of the supplied vector (right side) are added to the ECEF position vector on the left side of the equality, and a reference to this object is returned.
Definition at line 554 of file FGLocation.h.
|
inline |
This operator substracts two ECEF position vectors.
A new object is returned that defines a position which is the difference of the cartesian coordinates of the two positions provided.
Definition at line 598 of file FGLocation.h.
|
inline |
This operator substracts the ECEF position vectors.
The cartesian coordinates of the supplied vector (right side) are substracted from the ECEF position vector on the left side of the equality, and a reference to this object is returned.
Definition at line 564 of file FGLocation.h.
|
inline |
This operator scales the ECEF position vector.
The cartesian coordinates of the ECEF position vector on the left side of the equality are scaled by the inverse of the supplied value (right side), and a reference to this object is returned.
Definition at line 584 of file FGLocation.h.
|
inline |
Sets this location via the supplied vector.
The location can be set by an Earth-centered, Earth-fixed (ECEF) frame position vector. The cache is marked as invalid, so any future requests for selected important data will cause the parameters to be calculated.
v | the ECEF column vector in feet. |
Definition at line 525 of file FGLocation.h.
const FGLocation & operator= | ( | const FGLocation & | l | ) |
Sets this location via the supplied location object.
v | A location object reference. |
Definition at line 163 of file FGLocation.cpp.
|
inline |
This operator returns true if the ECEF location vectors for the two location objects are equal.
Definition at line 542 of file FGLocation.h.
|
inline |
Set the altitude above ground level.
altitudeAGL | altitude above Ground Level in feet. |
Definition at line 341 of file FGLocation.h.
|
inline |
Set the altitude above sea level.
altitudeASL | altitude above Sea Level in feet. |
Definition at line 335 of file FGLocation.h.
|
inline |
Sets the Earth position angle.
This is the relative orientation of the ECEF frame with respect to the Inertial frame.
EPA | Earth fixed frame (ECEF) rotation offset about the axis with respect to the Inertial (ECI) frame in radians. |
Definition at line 241 of file FGLocation.h.
void SetEllipse | ( | double | semimajor, |
double | semiminor | ||
) |
Sets the semimajor and semiminor axis lengths for this planet.
The eccentricity and flattening are calculated from the semimajor and semiminor axis lengths
Definition at line 285 of file FGLocation.cpp.
|
inlinestatic |
Sets the ground callback pointer.
The FGGroundCallback instance will be interrogated by FGLocation each time some terrain informations are needed. This will mainly occur when altitudes above the sea level or above the ground level are needed. A 'smart pointer' is used internally to prevent the FGGroundCallback instance against accidental deletion. This can only work if the calling application also make use of FGGroundCallback_ptr 'smart pointers' to manage their copy of the ground callback.
gc | A pointer to a ground callback object |
Definition at line 393 of file FGLocation.h.
void SetLatitude | ( | double | latitude | ) |
Set the latitude.
latitude | Latitude in rad to set. Sets the latitude of the location represented with this class instance to the value of the given argument. The value is meant to be in rad. The longitude and the radius value are preserved with this call with the exception of radius being equal to zero. If the radius is previously set to zero it is changed to be equal to 1.0 past this call. Latitude is positive north and negative south. The arguments should be within the bounds of -pi/2 <= lat <= pi/2. The behavior of this function with arguments outside this range is left as an exercise to the gentle reader ... |
Definition at line 217 of file FGLocation.cpp.
void SetLongitude | ( | double | longitude | ) |
Set the longitude.
longitude | Longitude in rad to set. Sets the longitude of the location represented with this class instance to the value of the given argument. The value is meant to be in rad. The latitude and the radius value are preserved with this call with the exception of radius being equal to zero. If the radius is previously set to zero it is changed to be equal to 1.0 past this call. Longitude is positive east and negative west. |
Definition at line 197 of file FGLocation.cpp.
void SetPosition | ( | double | lon, |
double | lat, | ||
double | radius | ||
) |
Sets the longitude, latitude and the distance from the center of the earth.
lon | longitude in radians |
lat | GEOCENTRIC latitude in radians |
radius | distance from center of earth to vehicle in feet |
Definition at line 254 of file FGLocation.cpp.
void SetPositionGeodetic | ( | double | lon, |
double | lat, | ||
double | height | ||
) |
Sets the longitude, latitude and the distance above the reference ellipsoid.
lon | longitude in radians |
lat | GEODETIC latitude in radians |
height | distance above the reference ellipsoid to vehicle in feet |
Definition at line 270 of file FGLocation.cpp.
void SetRadius | ( | double | radius | ) |
Set the distance from the center of the earth.
radius | Radius in ft to set. Sets the radius of the location represented with this class instance to the value of the given argument. The value is meant to be in ft. The latitude and longitude values are preserved with this call with the exception of radius being equal to zero. If the radius is previously set to zero, latitude and longitude is set equal to zero past this call. The argument should be positive. The behavior of this function called with a negative argument is left as an exercise to the gentle reader ... |
Definition at line 241 of file FGLocation.cpp.