SimGear - Simulator Construction Tools
sg_geodesy.hxx File Reference
#include "SGMath.hxx"

Go to the source code of this file.

Functions

int geo_direct_wgs_84 (double lat1, double lon1, double az1, double s, double *lat2, double *lon2, double *az2)
 
int geo_direct_wgs_84 (double alt, double lat1, double lon1, double az1, double s, double *lat2, double *lon2, double *az2)
 
int geo_direct_wgs_84 (const SGGeod &p1, double az1, double s, SGGeod &p2, double *az2)
 
int geo_inverse_wgs_84 (double lat1, double lon1, double lat2, double lon2, double *az1, double *az2, double *s)
 
int geo_inverse_wgs_84 (double alt, double lat1, double lon1, double lat2, double lon2, double *az1, double *az2, double *s)
 
int geo_inverse_wgs_84 (const SGGeod &p1, const SGGeod &p2, double *az1, double *az2, double *s)
 
void sgCartToGeod (const double *xyz, double *lat, double *lon, double *alt)
 
void sgGeodToCart (double lat, double lon, double alt, double *xyz)
 
void sgGeodToGeoc (double lat_geod, double alt, double *sl_radius, double *lat_geoc)
 

Function Documentation

int geo_direct_wgs_84 ( double  lat1,
double  lon1,
double  az1,
double  s,
double *  lat2,
double *  lon2,
double *  az2 
)
inline

Given a starting position and an offset radial and distance, calculate an ending positon on a wgs84 ellipsoid.

Parameters
alt(in) meters (unused)
lat1(in) degrees
lon1(in) degrees
az1(in) degrees
s(in) distance in meters
lat2(out) degrees
lon2(out) degrees
az2(out) return course in degrees

Definition at line 83 of file sg_geodesy.hxx.

Referenced by geo_direct_wgs_84().

int geo_direct_wgs_84 ( double  alt,
double  lat1,
double  lon1,
double  az1,
double  s,
double *  lat2,
double *  lon2,
double *  az2 
)
inline

Definition at line 94 of file sg_geodesy.hxx.

int geo_direct_wgs_84 ( const SGGeod p1,
double  az1,
double  s,
SGGeod p2,
double *  az2 
)
inline

Given a starting position and an offset radial and distance, calculate an ending positon on a wgs84 ellipsoid.

Parameters
p1(in) geodetic position
az1(in) degrees
s(in) distance in meters
p2(out) geodetic position
az2(out) return course in degrees

Definition at line 109 of file sg_geodesy.hxx.

int geo_inverse_wgs_84 ( double  lat1,
double  lon1,
double  lat2,
double  lon2,
double *  az1,
double *  az2,
double *  s 
)
inline

Given an altitude and two sets of (lat, lon) calculate great circle distance between them as well as the starting and ending azimuths.

Parameters
alt(in) meters (unused)
lat1(in) degrees
lon1(in) degrees
lat2(in) degrees
lon2(in) degrees
az1(out) start heading degrees
az2(out) end heading degrees
s(out) distance meters

Definition at line 127 of file sg_geodesy.hxx.

Referenced by geo_inverse_wgs_84().

int geo_inverse_wgs_84 ( double  alt,
double  lat1,
double  lon1,
double  lat2,
double  lon2,
double *  az1,
double *  az2,
double *  s 
)
inline

Definition at line 134 of file sg_geodesy.hxx.

int geo_inverse_wgs_84 ( const SGGeod p1,
const SGGeod p2,
double *  az1,
double *  az2,
double *  s 
)
inline

Given an altitude and two sets of (lat, lon) calculate great circle distance between them as well as the starting and ending azimuths.

Parameters
p1(in) first position
p2(in) fsecond position
az1(out) start heading degrees
az2(out) end heading degrees
s(out) distance meters

Definition at line 150 of file sg_geodesy.hxx.

void sgCartToGeod ( const double *  xyz,
double *  lat,
double *  lon,
double *  alt 
)
inline

Convert a cartesian point to a geodetic lat/lon/altitude.

Parameters
xyz(in) Pointer to cartesian point.
lat(out) Latitude, in radians
lon(out) Longitude, in radians
alt(out) Altitude, in meters above the WGS84 ellipsoid

Definition at line 45 of file sg_geodesy.hxx.

void sgGeodToCart ( double  lat,
double  lon,
double  alt,
double *  xyz 
)
inline

Convert a geodetic lat/lon/altitude to a cartesian point.

Parameters
lat(in) Latitude, in radians
lon(in) Longitude, in radians
alt(in) Altitude, in meters above the WGS84 ellipsoid
xyz(out) Pointer to cartesian point.

Definition at line 62 of file sg_geodesy.hxx.

void sgGeodToGeoc ( double  lat_geod,
double  alt,
double *  sl_radius,
double *  lat_geoc 
)
inline

Convert from geodetic coordinates to geocentric coordinates. WARNING: this function is non-reversible. Due to the fact that "up" is a different direction for geocentric and geodetic frames, you can not simply add your "alt" parameter to the "sl_radius" result and get back (via sgGeodToGeoc()) to the coordinates you started with. The error under normal conditions will be of centimeter order; whether that is important or not is application dependent. Consider using sgGeodToCart() instead.

Parameters
lat_geod(in) Geodetic latitude, radians, + = North
alt(in) C.G. altitude above mean sea level (meters)
sl_radius(out) SEA LEVEL radius to earth center (meters)
lat_geoc(out) Geocentric latitude, radians, + = North

Definition at line 24 of file sg_geodesy.hxx.