GeographicLib::Ellipsoid Class Reference

Properties of an ellipsoid. More...

#include <GeographicLib/Ellipsoid.hpp>

List of all members.

Public Member Functions

Constructor



 Ellipsoid (real a, real f)
Ellipsoid dimensions.



Math::real MajorRadius () const
Math::real MinorRadius () const
Math::real QuarterMeridian () const
Math::real Area () const
Math::real Volume () const
Ellipsoid shape



Math::real Flattening () const
Math::real SecondFlattening () const
Math::real ThirdFlattening () const
Math::real EccentricitySq () const
Math::real SecondEccentricitySq () const
Math::real ThirdEccentricitySq () const
Latitude conversion.



Math::real ParametricLatitude (real phi) const
Math::real InverseParametricLatitude (real beta) const
Math::real GeocentricLatitude (real phi) const
Math::real InverseGeocentricLatitude (real theta) const
Math::real RectifyingLatitude (real phi) const
Math::real InverseRectifyingLatitude (real mu) const
Math::real AuthalicLatitude (real phi) const
Math::real InverseAuthalicLatitude (real xi) const
Math::real ConformalLatitude (real phi) const
Math::real InverseConformalLatitude (real chi) const
Math::real IsometricLatitude (real phi) const
Math::real InverseIsometricLatitude (real psi) const
Other quantities.



Math::real CircleRadius (real phi) const
Math::real CircleHeight (real phi) const
Math::real MeridianDistance (real phi) const
Math::real MeridionalCurvatureRadius (real phi) const
Math::real TransverseCurvatureRadius (real phi) const
Math::real NormalCurvatureRadius (real phi, real azi) const

Static Public Member Functions

static const EllipsoidWGS84 ()
Eccentricity conversions.



static Math::real SecondFlatteningToFlattening (real fp)
static Math::real FlatteningToSecondFlattening (real f)
static Math::real ThirdFlatteningToFlattening (real n)
static Math::real FlatteningToThirdFlattening (real f)
static Math::real EccentricitySqToFlattening (real e2)
static Math::real FlatteningToEccentricitySq (real f)
static Math::real SecondEccentricitySqToFlattening (real ep2)
static Math::real FlatteningToSecondEccentricitySq (real f)
static Math::real ThirdEccentricitySqToFlattening (real epp2)
static Math::real FlatteningToThirdEccentricitySq (real f)

Friends

class Rhumb
class RhumbLine

Detailed Description

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.


Constructor & Destructor Documentation

GeographicLib::Ellipsoid::Ellipsoid ( real  a,
real  f 
)

Constructor for a ellipsoid with

Parameters:
[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.
Exceptions:
GeographicErr if a or (1 f) a is not positive.

Definition at line 16 of file Ellipsoid.cpp.


Member Function Documentation

Math::real GeographicLib::Ellipsoid::MajorRadius (  )  const [inline]
Returns:
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.

Definition at line 91 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::MinorRadius (  )  const [inline]
Returns:
b the polar semi-axis (meters).

Definition at line 96 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::QuarterMeridian (  )  const
Returns:
L the distance between the equator and a pole along a meridian (meters). For a sphere L = (/2) a. The radius of a sphere with the same meridian length is L / (/2).

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
Returns:
A the total area of the ellipsoid (meters2). For a sphere A = 4 a2. The radius of a sphere with the same area is sqrt(A / (4)).

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]
Returns:
V the total volume of the ellipsoid (meters3). For a sphere V = (4 / 3) a3. The radius of a sphere with the same volume is cbrt(V / (4/3)).

Definition at line 117 of file Ellipsoid.hpp.

References GeographicLib::Math::pi(), and GeographicLib::Math::sq().

Math::real GeographicLib::Ellipsoid::Flattening (  )  const [inline]
Returns:
f = (a b) / a, the flattening of the ellipsoid. This is the value used in the constructor. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 131 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::SecondFlattening (  )  const [inline]
Returns:
f ' = (a b) / b, the second flattening of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 138 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::ThirdFlattening (  )  const [inline]
Returns:
n = (a b) / (a + b), the third flattening of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 145 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::EccentricitySq (  )  const [inline]
Returns:
e2 = (a2 b2) / a2, the eccentricity squared of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 153 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::SecondEccentricitySq (  )  const [inline]
Returns:
e' 2 = (a2 b2) / b2, the second eccentricity squared of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 161 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::ThirdEccentricitySq (  )  const [inline]
Returns:
e'' 2 = (a2 b2) / (a2 + b2), the third eccentricity squared of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 170 of file Ellipsoid.hpp.

Math::real GeographicLib::Ellipsoid::ParametricLatitude ( real  phi  )  const
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the parametric 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

  • R = a cos
  • Z = b sin

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
Parameters:
[in] beta the parametric latitude (degrees).
Returns:
the geographic 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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the geocentric 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
Parameters:
[in] theta the geocentric latitude (degrees).
Returns:
the geographic 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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the rectifying 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
Parameters:
[in] mu the rectifying latitude (degrees).
Returns:
the geographic 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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the authalic 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
Parameters:
[in] xi the authalic latitude (degrees).
Returns:
the geographic 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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the conformal 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
Parameters:
[in] chi the conformal latitude (degrees).
Returns:
the geographic 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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the isometric 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
Parameters:
[in] psi the isometric latitude (degrees).
Returns:
the geographic 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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
R = a cos the radius of a circle of latitude (meters). R (/180) gives meters per degree longitude measured along a circle of latitude.

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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
Z = b sin the distance of a circle of latitude from the equator measured parallel to the ellipsoid axis (meters).

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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
s the distance along a meridian between the equator and a point of latitude (meters). s is given by s = L / 90, where L = QuarterMeridian()).

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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the meridional radius of curvature of the ellipsoid at latitude (meters); this is the curvature of the meridian. rho is given by = (180/) ds / d, where s = MeridianDistance(); thus (/180) gives meters per degree latitude measured along a meridian.

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
Parameters:
[in] phi the geographic latitude (degrees).
Returns:
the transverse radius of curvature of the ellipsoid at latitude (meters); this is the curvature of a curve on the ellipsoid which also lies in a plane perpendicular to the ellipsoid and to the meridian. is related to R = CircleRadius() by R = cos .

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
Parameters:
[in] phi the geographic latitude (degrees).
[in] azi the angle between the meridian and the normal section (degrees).
Returns:
the radius of curvature of the ellipsoid in the normal section at latitude inclined at an angle azi to the meridian (meters).

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]
Parameters:
[in] fp = f ' = (a b) / b, the second flattening.
Returns:
f = (a b) / a, the 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]
Parameters:
[in] f = (a b) / a, the flattening.
Returns:
f ' = (a b) / b, the second 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]
Parameters:
[in] n = (a b) / (a + b), the third flattening.
Returns:
f = (a b) / a, the 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]
Parameters:
[in] f = (a b) / a, the flattening.
Returns:
n = (a b) / (a + b), the third 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]
Parameters:
[in] e2 = e2 = (a2 b2) / a2, the eccentricity squared.
Returns:
f = (a b) / a, the flattening.

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]
Parameters:
[in] f = (a b) / a, the flattening.
Returns:
e2 = (a2 b2) / a2, the eccentricity squared.

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]
Parameters:
[in] ep2 = e' 2 = (a2 b2) / b2, the second eccentricity squared.
Returns:
f = (a b) / a, the flattening.

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]
Parameters:
[in] f = (a b) / a, the flattening.
Returns:
e' 2 = (a2 b2) / b2, the second eccentricity squared.

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]
Parameters:
[in] epp2 = e'' 2 = (a2 b2) / (a2 + b2), the third eccentricity squared.
Returns:
f = (a b) / a, the flattening.

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]
Parameters:
[in] f = (a b) / a, the flattening.
Returns:
e'' 2 = (a2 b2) / (a2 + b2), the third eccentricity squared.

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().


Friends And Related Function Documentation

friend class Rhumb [friend]

Definition at line 64 of file Ellipsoid.hpp.

friend class RhumbLine [friend]

Definition at line 64 of file Ellipsoid.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 6 Oct 2014 for GeographicLib by  doxygen 1.6.1