Properties of an ellipsoid. More...
#include <GeographicLib/Ellipsoid.hpp>
Properties of an ellipsoid.
This class returns various properties of the ellipsoid and converts between various types of latitudes. The latitude conversions are also possible using the various projections supported by GeographicLib; but Ellipsoid provides more direct access (sometimes using private functions of the projection classes). Ellipsoid::RectifyingLatitude, Ellipsoid::InverseRectifyingLatitude, and Ellipsoid::MeridianDistance provide functionality which can be provided by the Geodesic class. However Geodesic uses a series approximation (valid for abs f < 1/150), whereas Ellipsoid computes these quantities using EllipticFunction which provides accurate results even when f is large. Use of this class should be limited to 3 < f < 3/4 (i.e., 1/4 < b/a < 4).
Example of use:
// Example of using the GeographicLib::Ellipsoid class #include <iostream> #include <exception> #include <GeographicLib/Ellipsoid.hpp> using namespace std; using namespace GeographicLib; int main() { try { Ellipsoid wgs84(Constants::WGS84_a(), Constants::WGS84_f()); // Alternatively: const Ellipsoid& wgs84 = Ellipsoid::WGS84(); cout << "The latitude half way between the equator and the pole is " << wgs84.InverseRectifyingLatitude(45) << "\n"; cout << "Half the area of the ellipsoid lies between latitudes +/- " << wgs84.InverseAuthalicLatitude(30) << "\n"; cout << "The northernmost edge of a square Mercator map is at latitude " << wgs84.InverseIsometricLatitude(180) << "\n"; } catch (const exception& e) { cerr << "Caught exception: " << e.what() << "\n"; return 1; } return 0; }
Definition at line 39 of file Ellipsoid.hpp.
GeographicLib::Ellipsoid::Ellipsoid | ( | real | a, | |
real | f | |||
) |
Constructor for a ellipsoid with
[in] | a | equatorial radius (meters). |
[in] | f | flattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid. If f > 1, set flattening to 1/f. |
GeographicErr | if a or (1 f) a is not positive. |
Definition at line 16 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::MajorRadius | ( | ) | const [inline] |
Definition at line 91 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::MinorRadius | ( | ) | const [inline] |
Definition at line 96 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::QuarterMeridian | ( | ) | const |
Definition at line 37 of file Ellipsoid.cpp.
References GeographicLib::EllipticFunction::E().
Referenced by GeographicLib::Rhumb::Inverse(), GeographicLib::RhumbLine::Position(), and RectifyingLatitude().
Math::real GeographicLib::Ellipsoid::Area | ( | ) | const |
Definition at line 40 of file Ellipsoid.cpp.
References GeographicLib::Math::atanh(), GeographicLib::Math::pi(), and GeographicLib::Math::sq().
Math::real GeographicLib::Ellipsoid::Volume | ( | ) | const [inline] |
Definition at line 117 of file Ellipsoid.hpp.
References GeographicLib::Math::pi(), and GeographicLib::Math::sq().
Math::real GeographicLib::Ellipsoid::Flattening | ( | ) | const [inline] |
Definition at line 131 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::SecondFlattening | ( | ) | const [inline] |
Definition at line 138 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::ThirdFlattening | ( | ) | const [inline] |
Definition at line 145 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::EccentricitySq | ( | ) | const [inline] |
Definition at line 153 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::SecondEccentricitySq | ( | ) | const [inline] |
Definition at line 161 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::ThirdEccentricitySq | ( | ) | const [inline] |
Definition at line 170 of file Ellipsoid.hpp.
Math::real GeographicLib::Ellipsoid::ParametricLatitude | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
The geographic latitude, , is the angle beween the equatorial plane and a vector normal to the surface of the ellipsoid.
The parametric latitude (also called the reduced latitude), , allows the cartesian coordinated of a meridian to be expressed conveniently in parametric form as
where a and b are the equatorial radius and the polar semi-axis. For a sphere = .
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 48 of file Ellipsoid.cpp.
Referenced by MeridianDistance().
Math::real GeographicLib::Ellipsoid::InverseParametricLatitude | ( | real | beta | ) | const |
[in] | beta | the parametric latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 51 of file Ellipsoid.cpp.
Referenced by InverseRectifyingLatitude().
Math::real GeographicLib::Ellipsoid::GeocentricLatitude | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
The geocentric latitude, , is the angle beween the equatorial plane and a line between the center of the ellipsoid and a point on the ellipsoid. For a sphere = .
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 54 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::InverseGeocentricLatitude | ( | real | theta | ) | const |
[in] | theta | the geocentric latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 57 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::RectifyingLatitude | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
The rectifying latitude, , has the property that the distance along a meridian of the ellipsoid between two points with rectifying latitudes 1 and 2 is equal to (2 - 1) L / 90, where L = QuarterMeridian(). For a sphere = .
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 60 of file Ellipsoid.cpp.
References MeridianDistance(), and QuarterMeridian().
Math::real GeographicLib::Ellipsoid::InverseRectifyingLatitude | ( | real | mu | ) | const |
[in] | mu | the rectifying latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 65 of file Ellipsoid.cpp.
References GeographicLib::Math::degree(), GeographicLib::EllipticFunction::E(), GeographicLib::EllipticFunction::Einv(), and InverseParametricLatitude().
Referenced by GeographicLib::RhumbLine::Position().
Math::real GeographicLib::Ellipsoid::AuthalicLatitude | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
The authalic latitude, , has the property that the area of the ellipsoid between two circles with authalic latitudes 1 and 2 is equal to (sin 2 - sin 1) A / 2, where A = Area(). For a sphere = .
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 72 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::InverseAuthalicLatitude | ( | real | xi | ) | const |
[in] | xi | the authalic latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 75 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::ConformalLatitude | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
The conformal latitude, , gives the mapping of the ellipsoid to a sphere which which is conformal (angles are preserved) and in which the equator of the ellipsoid maps to the equator of the sphere. For a sphere = .
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 78 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::InverseConformalLatitude | ( | real | chi | ) | const |
[in] | chi | the conformal latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The returned value lies in [90, 90].
Definition at line 81 of file Ellipsoid.cpp.
Math::real GeographicLib::Ellipsoid::IsometricLatitude | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
The isometric latitude gives the mapping of the ellipsoid to a plane which which is conformal (angles are preserved) and in which the equator of the ellipsoid maps to a straight line of constant scale; this mapping defines the Mercator projection. For a sphere = sinh1 tan .
must lie in the range [90, 90]; the result is undefined if this condition does not hold. The value returned for = 90 is some (positive or negative) large but finite value, such that InverseIsometricLatitude returns the original value of .
Definition at line 84 of file Ellipsoid.cpp.
References GeographicLib::Math::asinh(), and GeographicLib::Math::degree().
Referenced by GeographicLib::Rhumb::Inverse().
Math::real GeographicLib::Ellipsoid::InverseIsometricLatitude | ( | real | psi | ) | const |
[in] | psi | the isometric latitude (degrees). |
The returned value lies in [90, 90]. For a sphere = tan1 sinh .
Definition at line 87 of file Ellipsoid.cpp.
References GeographicLib::Math::degree().
Math::real GeographicLib::Ellipsoid::CircleRadius | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold.
Definition at line 90 of file Ellipsoid.cpp.
References GeographicLib::Math::hypot().
Math::real GeographicLib::Ellipsoid::CircleHeight | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold.
Definition at line 96 of file Ellipsoid.cpp.
References GeographicLib::Math::hypot().
Math::real GeographicLib::Ellipsoid::MeridianDistance | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold.
Definition at line 102 of file Ellipsoid.cpp.
References GeographicLib::EllipticFunction::Ed(), and ParametricLatitude().
Referenced by RectifyingLatitude().
Math::real GeographicLib::Ellipsoid::MeridionalCurvatureRadius | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold.
Definition at line 105 of file Ellipsoid.cpp.
References GeographicLib::Math::degree(), and GeographicLib::Math::sq().
Math::real GeographicLib::Ellipsoid::TransverseCurvatureRadius | ( | real | phi | ) | const |
[in] | phi | the geographic latitude (degrees). |
must lie in the range [90, 90]; the result is undefined if this condition does not hold.
Definition at line 110 of file Ellipsoid.cpp.
References GeographicLib::Math::degree(), and GeographicLib::Math::sq().
Math::real GeographicLib::Ellipsoid::NormalCurvatureRadius | ( | real | phi, | |
real | azi | |||
) | const |
[in] | phi | the geographic latitude (degrees). |
[in] | azi | the angle between the meridian and the normal section (degrees). |
must lie in the range [90, 90] and azi must lie in the range [540, 540); the result is undefined if either of conditions does not hold.
Definition at line 115 of file Ellipsoid.cpp.
References GeographicLib::Math::degree(), and GeographicLib::Math::sq().
static Math::real GeographicLib::Ellipsoid::SecondFlatteningToFlattening | ( | real | fp | ) | [inline, static] |
[in] | fp | = f ' = (a b) / b, the second flattening. |
f ' should lie in (1, ). The returned value f lies in (, 1).
Definition at line 428 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::FlatteningToSecondFlattening | ( | real | f | ) | [inline, static] |
[in] | f | = (a b) / a, the flattening. |
f should lie in (, 1). The returned value f ' lies in (1, ).
Definition at line 438 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::ThirdFlatteningToFlattening | ( | real | n | ) | [inline, static] |
[in] | n | = (a b) / (a + b), the third flattening. |
n should lie in (1, 1). The returned value f lies in (, 1).
Definition at line 449 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::FlatteningToThirdFlattening | ( | real | f | ) | [inline, static] |
[in] | f | = (a b) / a, the flattening. |
f should lie in (, 1). The returned value n lies in (1, 1).
Definition at line 460 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::EccentricitySqToFlattening | ( | real | e2 | ) | [inline, static] |
[in] | e2 | = e2 = (a2 b2) / a2, the eccentricity squared. |
e2 should lie in (, 1). The returned value f lies in (, 1).
Definition at line 472 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::FlatteningToEccentricitySq | ( | real | f | ) | [inline, static] |
[in] | f | = (a b) / a, the flattening. |
f should lie in (, 1). The returned value e2 lies in (, 1).
Definition at line 484 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::SecondEccentricitySqToFlattening | ( | real | ep2 | ) | [inline, static] |
[in] | ep2 | = e' 2 = (a2 b2) / b2, the second eccentricity squared. |
e' 2 should lie in (1, ). The returned value f lies in (, 1).
Definition at line 496 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::FlatteningToSecondEccentricitySq | ( | real | f | ) | [inline, static] |
[in] | f | = (a b) / a, the flattening. |
f should lie in (, 1). The returned value e' 2 lies in (1, ).
Definition at line 508 of file Ellipsoid.hpp.
References GeographicLib::Math::sq().
static Math::real GeographicLib::Ellipsoid::ThirdEccentricitySqToFlattening | ( | real | epp2 | ) | [inline, static] |
[in] | epp2 | = e'' 2 = (a2 b2) / (a2 + b2), the third eccentricity squared. |
e'' 2 should lie in (1, 1). The returned value f lies in (, 1).
Definition at line 520 of file Ellipsoid.hpp.
static Math::real GeographicLib::Ellipsoid::FlatteningToThirdEccentricitySq | ( | real | f | ) | [inline, static] |
[in] | f | = (a b) / a, the flattening. |
f should lie in (, 1). The returned value e'' 2 lies in (1, 1).
Definition at line 532 of file Ellipsoid.hpp.
References GeographicLib::Math::sq().
const Ellipsoid & GeographicLib::Ellipsoid::WGS84 | ( | ) | [static] |
A global instantiation of Ellipsoid with the parameters for the WGS84 ellipsoid.
Definition at line 32 of file Ellipsoid.cpp.
References GeographicLib::Constants::WGS84_a(), and GeographicLib::Constants::WGS84_f().
friend class Rhumb [friend] |
Definition at line 64 of file Ellipsoid.hpp.
friend class RhumbLine [friend] |
Definition at line 64 of file Ellipsoid.hpp.