#include <ellipsoid.h>
Public Member Functions | |
void | print (ostream &os) const |
print ellipsoid parameters | |
const char * | ell_name () const |
get ellipsoid name | |
bool | is_valid () const |
check if valid reference ellipsoid | |
double | nradius (double b) const |
radius of curvature in the prime vertical | |
double | mradius (double b) const |
meridian radius of curvature | |
double | dist (double psi) const |
geocentric distance | |
double | arc (double b) const |
length of meridian arc | |
double | inv_arc (double g) const |
latitude of meridian arc | |
double | q (double b) const |
isometric latitude from ellipsoidic latitude | |
double | inv_q (double q) const |
ellipsoidic latitude from isometric latitude | |
constructor/destructors | |
Ellipsoid () | |
default constructor | |
Ellipsoid (const char *name, double a, double f) | |
constructor with ellipsoid parameters | |
Ellipsoid (const string &name) | |
constructor with ellipsoid name | |
virtual | ~Ellipsoid () |
destructor | |
set reference ellipsoid | |
Set the parameters of the reference ellipsoid directly or by using the data base. The default file name of the data base is ell_pars.db. | |
void | set (const char *name, double a, double f) |
set reference ellipsoid parameters directly | |
bool | set (istream &is, const string &name) |
using data base read from stream | |
bool | set (const string &fname, const string &name) |
using data base in file | |
bool | set (const string &name) |
using local default file | |
conversion between geographic and geocentric latitude | |
see Grossmann, 13.4, S. 9 and personal notes | |
double | geog_to_geoc (double b) const |
geocentric from geographic latitude | |
double | geoc_to_geog (double psi) const |
geographic from geocentric latitude | |
geocentric cartesian / geodetic coordinates conversion | |
Conversion between geocentric cartesian (x, y, z) and geodetic (b, l, h) coordinates. | |
void | geo_to_cart (double b, double l, double h, double &x, double &y, double &z) const |
conversion from geodetic to cartesian coordinates | |
void | cart_to_geo (double x, double y, double z, double &b, double &l, double &h) const |
conversion from cartesian to geodetic coordinates | |
Protected Attributes | |
string | _name |
name of rotational ellipsoid | |
double | _a |
semimajor axis | |
double | _b |
semiminor axis | |
double | _c |
polar radius of curvature | |
double | _f |
flattening | |
double | _e2 |
square of first eccentricity | |
double | _e22 |
square of second eccentricity | |
Private Member Functions | |
void | calc_params () |
calculate ellipsoid parameters | |
void | calc_coeffs () |
calculate coefficients for computation of the meridian arc | |
void | funcd (double x, double h, double &fn, double &df) const |
get length of the meridian arc and first derivative | |
Private Attributes | |
double | _a0 |
coeffs. for computation of the meridian arc | |
double | _a1 |
coefficent a1 | |
double | _a2 |
coefficent a2 | |
double | _a4 |
coefficent a4 | |
double | _a6 |
coefficent a6 | |
double | _a8 |
coefficent a8 |
This class provide geometric parameters and coordinate transformations in the ellipsoidal reference system.
A reference ellipsoid is a mathematically-defined surface that approximates the geoid, the true figure of the Earth or other planetary body (from Wikipedia). The system is defined by a rotational ellipsoid with flattened poles. The center of the reference ellipsoid coincidence with the earth center. The ellipsoid is created by rotating the meridian ellipse about its minor axis. Reference ellipsoids are defined by two parameters, e.g. the semi-major axis (equatorial radius) a and the flattening f. Sometimes other combinations parameters are used, e.g. the semi-minor axis b or the first eccentricity e.
Geocentric coordinates (earth-centered) define the position of a 3D point with respect to the origin of the ellipsoid. Using cartesian (x, y, z) coordinates the origin is at the center of the ellipsoid:
(Ellipsoidal) geographic or geodetic coordinates define the position of a 3D point with respect on the surface of the ellipsoid with:
The ellipsoid (or geodetic) height is the distance from the reference ellipsoid to the point in the direction normal to the ellipsoid.
References:
GCL::Ellipsoid::Ellipsoid | ( | ) |
default constructor
Initilize reference ellipsoid with unit sphere.
GCL::Ellipsoid::Ellipsoid | ( | const char * | name, | |
double | a, | |||
double | f | |||
) | [inline] |
constructor with ellipsoid parameters
[in] | name | name of the reference ellipsoid |
[in] | a | semimajor axis |
[in] | f | flattening |
GCL::Ellipsoid::Ellipsoid | ( | const string & | name | ) |
constructor with ellipsoid name
Set the parameters of the reference ellipsoid using the data base. The default file name of the data base is ell_pars.db.
[in] | name | name of the reference ellipsoid in the data base |
void GCL::Ellipsoid::set | ( | const char * | name, | |
double | a, | |||
double | f | |||
) |
set reference ellipsoid parameters directly
[in] | name | name of the reference ellipsoid |
[in] | a | semimajor axis |
[in] | f | flattening |
References _a, _f, _name, calc_coeffs(), and calc_params().
bool GCL::Ellipsoid::set | ( | istream & | is, | |
const string & | name | |||
) |
using data base read from stream
[in] | is | input stream |
[in] | name | name of the reference ellipsoid |
bool GCL::Ellipsoid::set | ( | const string & | fname, | |
const string & | name | |||
) |
using data base in file
[in] | fname | file name |
[in] | name | name of the reference ellipsoid |
bool GCL::Ellipsoid::set | ( | const string & | name | ) |
using local default file
[in] | name | name of the reference ellipsoid |
void GCL::Ellipsoid::print | ( | ostream & | os | ) | const |
print ellipsoid parameters
[in] | os | output stream |
Reimplemented in GCL::ConvGeocLoc, GCL::Lambert2, and GCL::Projection.
References _a, _b, _c, _e2, _e22, _f, and _name.
Referenced by GCL::ConvGeocLoc::print().
double GCL::Ellipsoid::nradius | ( | double | b | ) | const [inline] |
radius of curvature in the prime vertical
see Torge, (3.26), S. 51
[in] | b | geographic latitude |
Referenced by GCL::Lambert2::geo_to_map(), GCL::Lambert1::geo_to_map(), GCL::Lambert2::map_to_geo(), and GCL::Lambert1::map_to_geo().
double GCL::Ellipsoid::mradius | ( | double | b | ) | const [inline] |
double GCL::Ellipsoid::dist | ( | double | psi | ) | const [inline] |
double GCL::Ellipsoid::arc | ( | double | b | ) | const |
length of meridian arc
[in] | b | geographic latitude |
References _a0, _a1, _a2, _a4, _a6, _a8, and _c.
Referenced by funcd(), GCL::GIC::geo_to_iso(), and GCL::GKK::geo_to_map().
double GCL::Ellipsoid::inv_arc | ( | double | g | ) | const |
latitude of meridian arc
[in] | g | length of meridian arc |
Referenced by GCL::GIC::iso_to_geo(), and GCL::GKK::map_to_geo().
double GCL::Ellipsoid::q | ( | double | b | ) | const |
isometric latitude from ellipsoidic latitude
see Heck, (6.92b), S. 202
[in] | b | geographic latitude |
References _e2.
Referenced by cart_to_geo(), GCL::Lambert2::geo_to_map(), GCL::Lambert1::geo_to_map(), GCL::Lambert2::map_to_geo(), and GCL::Lambert1::map_to_geo().
double GCL::Ellipsoid::inv_q | ( | double | q | ) | const |
ellipsoidic latitude from isometric latitude
see Numerical Recipies in C, 2nd Ed., p. 365ff
[in] | q | isometric latitude |
References _e2.
Referenced by GCL::Lambert2::map_to_geo(), and GCL::Lambert1::map_to_geo().
double GCL::Ellipsoid::geog_to_geoc | ( | double | b | ) | const |
geocentric from geographic latitude
[in] | b | geographic latitude |
References _e2.
double GCL::Ellipsoid::geoc_to_geog | ( | double | psi | ) | const |
geographic from geocentric latitude
[in] | psi | geocentric latitude |
References _e2.
void GCL::Ellipsoid::geo_to_cart | ( | double | b, | |
double | l, | |||
double | h, | |||
double & | x, | |||
double & | y, | |||
double & | z | |||
) | const |
conversion from geodetic to cartesian coordinates
[in] | b,l | geographic latitude and longitude |
[in] | h | ellipsoid height |
[out] | x,y,z | geocentric cartesian coordinates |
Referenced by GCL::ConvGeocLoc::geo_to_loc(), and GCL::ConvGeocLoc::set_reference_point().
void GCL::Ellipsoid::cart_to_geo | ( | double | x, | |
double | y, | |||
double | z, | |||
double & | b, | |||
double & | l, | |||
double & | h | |||
) | const |
conversion from cartesian to geodetic coordinates
[in] | x,y,z | geocentric cartesian coordinates |
[out] | b,l | geographic latitude and longitude |
[out] | h | ellipsoid height |
Referenced by GCL::ConvGeocLoc::loc_to_geo().
void GCL::Ellipsoid::calc_params | ( | ) | [private] |
double GCL::Ellipsoid::_a0 [private] |