NETGeographicLib  1.43
Public Member Functions | List of all members
NETGeographicLib::Ellipsoid Class Reference

.NET wrapper for GeographicLib::Ellipsoid. More...

#include <NETGeographicLib/Ellipsoid.h>

Public Member Functions

 ~Ellipsoid ()
 
Constructor
 Ellipsoid ()
 
 Ellipsoid (double a, double f)
 
Latitude conversion.
double ParametricLatitude (double phi)
 
double InverseParametricLatitude (double beta)
 
double GeocentricLatitude (double phi)
 
double InverseGeocentricLatitude (double theta)
 
double RectifyingLatitude (double phi)
 
double InverseRectifyingLatitude (double mu)
 
double AuthalicLatitude (double phi)
 
double InverseAuthalicLatitude (double xi)
 
double ConformalLatitude (double phi)
 
double InverseConformalLatitude (double chi)
 
double IsometricLatitude (double phi)
 
double InverseIsometricLatitude (double psi)
 
Other quantities.
double CircleRadius (double phi)
 
double CircleHeight (double phi)
 
double MeridianDistance (double phi)
 
double MeridionalCurvatureRadius (double phi)
 
double TransverseCurvatureRadius (double phi)
 
double NormalCurvatureRadius (double phi, double azi)
 

Static Public Member Functions

Eccentricity conversions.
static double SecondFlatteningToFlattening (double fp)
 
static double FlatteningToSecondFlattening (double f)
 
static double ThirdFlatteningToFlattening (double n)
 
static double FlatteningToThirdFlattening (double f)
 
static double EccentricitySqToFlattening (double e2)
 
static double FlatteningToEccentricitySq (double f)
 
static double SecondEccentricitySqToFlattening (double ep2)
 
static double FlatteningToSecondEccentricitySq (double f)
 
static double ThirdEccentricitySqToFlattening (double epp2)
 
static double FlatteningToThirdEccentricitySq (double f)
 

Properties

Ellipsoid dimensions.
double MajorRadius [get]
 
double MinorRadius [get]
 
double QuarterMeridian [get]
 
double Area [get]
 
double Volume [get]
 
Ellipsoid shape
double Flattening [get]
 
double SecondFlattening [get]
 
double ThirdFlattening [get]
 
double EccentricitySq [get]
 
double SecondEccentricitySq [get]
 
double ThirdEccentricitySq [get]
 

Detailed Description

.NET wrapper for GeographicLib::Ellipsoid.

This class allows .NET applications to access GeographicLib::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).

C# Example:

using System;
namespace example_Ellipsoid
{
class Program
{
static void Main(string[] args)
{
try {
Ellipsoid wgs84 = new Ellipsoid( Constants.WGS84.MajorRadius,
Constants.WGS84.Flattening);
// Alternatively: Ellipsoid wgs84 = new Ellipsoid();
Console.WriteLine( String.Format(
"The latitude half way between the equator and the pole is {0}",
wgs84.InverseRectifyingLatitude(45)) );
Console.WriteLine( String.Format(
"Half the area of the ellipsoid lies between latitudes +/- {0}",
wgs84.InverseAuthalicLatitude(30))); ;
Console.WriteLine( String.Format(
"The northernmost edge of a square Mercator map is at latitude {0}",
wgs84.InverseIsometricLatitude(180)));
}
catch (GeographicErr e) {
Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) );
}
}
}
}

Managed C++ Example:

using namespace System;
using namespace NETGeographicLib;
int main(array<System::String ^> ^/*args*/)
{
try {
// Alternatively: Ellipsoid^ wgs84 = gcnew Ellipsoid();
Console::WriteLine( String::Format(
"The latitude half way between the equator and the pole is {0}",
Console::WriteLine( String::Format(
"Half the area of the ellipsoid lies between latitudes +/- {0}",
wgs84->InverseAuthalicLatitude(30))); ;
Console::WriteLine( String::Format(
"The northernmost edge of a square Mercator map is at latitude {0}",
wgs84->InverseIsometricLatitude(180)));
}
catch (GeographicErr^ e) {
Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) );
return -1;
}
return 0;
}

Visual Basic Example:

Imports NETGeographicLib
Module example_Ellipsoid
Sub Main()
Try
Dim wgs84 As Ellipsoid = New Ellipsoid(Constants.WGS84.MajorRadius,
Constants.WGS84.Flattening)
' Alternatively: Dim wgs84 As Ellipsoid = new Ellipsoid()
Console.WriteLine(String.Format(
"The latitude half way between the equator and the pole is {0}",
wgs84.InverseRectifyingLatitude(45)))
Console.WriteLine(String.Format(
"Half the area of the ellipsoid lies between latitudes +/- {0}",
wgs84.InverseAuthalicLatitude(30)))
Console.WriteLine(String.Format(
"The northernmost edge of a square Mercator map is at latitude {0}",
wgs84.InverseIsometricLatitude(180)))
Catch ex As GeographicErr
Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
End Try
End Sub
End Module

INTERFACE DIFFERENCES:
A default constructor has been provided that assumes a WGS84 ellipsoid.

The following functions are implemented as properties: MajorRadius, MinorRadius, QuarterMeridian, Area, Volume, Flattening, SecondFlattening, ThirdFlattening, EccentricitySq, SecondEccentricitySq, and ThirdEccentricitySq.

Definition at line 47 of file Ellipsoid.h.

Constructor & Destructor Documentation

◆ Ellipsoid() [1/2]

NETGeographicLib::Ellipsoid::Ellipsoid ( )

Constructor for a WGS84 ellipsoid

Referenced by ~Ellipsoid().

◆ Ellipsoid() [2/2]

NETGeographicLib::Ellipsoid::Ellipsoid ( double  a,
double  f 
)

Constructor for a ellipsoid with

Parameters
[in]aequatorial radius (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid. If f > 1, set flattening to 1/f.
Exceptions
GeographicErrif a or (1 − f ) a is not positive.

◆ ~Ellipsoid()

NETGeographicLib::Ellipsoid::~Ellipsoid ( )
inline

The destructor calls the finalizer.

Definition at line 80 of file Ellipsoid.h.

References Ellipsoid().

Member Function Documentation

◆ ParametricLatitude()

double NETGeographicLib::Ellipsoid::ParametricLatitude ( double  phi)
Parameters
[in]phithe 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°].

◆ InverseParametricLatitude()

double NETGeographicLib::Ellipsoid::InverseParametricLatitude ( double  beta)
Parameters
[in]betathe 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°].

◆ GeocentricLatitude()

double NETGeographicLib::Ellipsoid::GeocentricLatitude ( double  phi)
Parameters
[in]phithe 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°].

◆ InverseGeocentricLatitude()

double NETGeographicLib::Ellipsoid::InverseGeocentricLatitude ( double  theta)
Parameters
[in]thetathe 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°].

◆ RectifyingLatitude()

double NETGeographicLib::Ellipsoid::RectifyingLatitude ( double  phi)
Parameters
[in]phithe 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°].

◆ InverseRectifyingLatitude()

double NETGeographicLib::Ellipsoid::InverseRectifyingLatitude ( double  mu)
Parameters
[in]muthe 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°].

◆ AuthalicLatitude()

double NETGeographicLib::Ellipsoid::AuthalicLatitude ( double  phi)
Parameters
[in]phithe 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°].

◆ InverseAuthalicLatitude()

double NETGeographicLib::Ellipsoid::InverseAuthalicLatitude ( double  xi)
Parameters
[in]xithe 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°].

◆ ConformalLatitude()

double NETGeographicLib::Ellipsoid::ConformalLatitude ( double  phi)
Parameters
[in]phithe 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°].

◆ InverseConformalLatitude()

double NETGeographicLib::Ellipsoid::InverseConformalLatitude ( double  chi)
Parameters
[in]chithe 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°].

◆ IsometricLatitude()

double NETGeographicLib::Ellipsoid::IsometricLatitude ( double  phi)
Parameters
[in]phithe 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 ψ = sinh−1 tan φ.

φ must lie in the range [−90°, 90°]; the result is undefined if this condition does not hold.

◆ InverseIsometricLatitude()

double NETGeographicLib::Ellipsoid::InverseIsometricLatitude ( double  psi)
Parameters
[in]psithe isometric latitude (degrees).
Returns
φ the geographic latitude (degrees).

The returned value φ lies in [−90°, 90°].

◆ CircleRadius()

double NETGeographicLib::Ellipsoid::CircleRadius ( double  phi)
Parameters
[in]phithe 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.

◆ CircleHeight()

double NETGeographicLib::Ellipsoid::CircleHeight ( double  phi)
Parameters
[in]phithe 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.

◆ MeridianDistance()

double NETGeographicLib::Ellipsoid::MeridianDistance ( double  phi)
Parameters
[in]phithe 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.

◆ MeridionalCurvatureRadius()

double NETGeographicLib::Ellipsoid::MeridionalCurvatureRadius ( double  phi)
Parameters
[in]phithe 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.

◆ TransverseCurvatureRadius()

double NETGeographicLib::Ellipsoid::TransverseCurvatureRadius ( double  phi)
Parameters
[in]phithe 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.

◆ NormalCurvatureRadius()

double NETGeographicLib::Ellipsoid::NormalCurvatureRadius ( double  phi,
double  azi 
)
Parameters
[in]phithe geographic latitude (degrees).
[in]azithe 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.

◆ SecondFlatteningToFlattening()

static double NETGeographicLib::Ellipsoid::SecondFlatteningToFlattening ( double  fp)
static
Parameters
[in]fp= f ' = (ab) / b, the second flattening.
Returns
f = (ab) / a, the flattening.

f ' should lie in (−1, ∞). The returned value f lies in (−∞, 1).

◆ FlatteningToSecondFlattening()

static double NETGeographicLib::Ellipsoid::FlatteningToSecondFlattening ( double  f)
static
Parameters
[in]f= (ab) / a, the flattening.
Returns
f ' = (ab) / b, the second flattening.

f should lie in (−∞, 1). The returned value f ' lies in (−1, ∞).

◆ ThirdFlatteningToFlattening()

static double NETGeographicLib::Ellipsoid::ThirdFlatteningToFlattening ( double  n)
static
Parameters
[in]n= (ab) / (a + b), the third flattening.
Returns
f = (ab) / a, the flattening.

n should lie in (−1, 1). The returned value f lies in (−∞, 1).

◆ FlatteningToThirdFlattening()

static double NETGeographicLib::Ellipsoid::FlatteningToThirdFlattening ( double  f)
static
Parameters
[in]f= (ab) / a, the flattening.
Returns
n = (ab) / (a + b), the third flattening.

f should lie in (−∞, 1). The returned value n lies in (−1, 1).

◆ EccentricitySqToFlattening()

static double NETGeographicLib::Ellipsoid::EccentricitySqToFlattening ( double  e2)
static
Parameters
[in]e2= e2 = (a2b2) / a2, the eccentricity squared.
Returns
f = (ab) / a, the flattening.

e2 should lie in (−∞, 1). The returned value f lies in (−∞, 1).

◆ FlatteningToEccentricitySq()

static double NETGeographicLib::Ellipsoid::FlatteningToEccentricitySq ( double  f)
static
Parameters
[in]f= (ab) / a, the flattening.
Returns
e2 = (a2b2) / a2, the eccentricity squared.

f should lie in (−∞, 1). The returned value e2 lies in (−∞, 1).

◆ SecondEccentricitySqToFlattening()

static double NETGeographicLib::Ellipsoid::SecondEccentricitySqToFlattening ( double  ep2)
static
Parameters
[in]ep2= e' 2 = (a2b2) / b2, the second eccentricity squared.
Returns
f = (ab) / a, the flattening.

e' 2 should lie in (−1, ∞). The returned value f lies in (−∞, 1).

◆ FlatteningToSecondEccentricitySq()

static double NETGeographicLib::Ellipsoid::FlatteningToSecondEccentricitySq ( double  f)
static
Parameters
[in]f= (ab) / a, the flattening.
Returns
e' 2 = (a2b2) / b2, the second eccentricity squared.

f should lie in (−∞, 1). The returned value e' 2 lies in (−1, ∞).

◆ ThirdEccentricitySqToFlattening()

static double NETGeographicLib::Ellipsoid::ThirdEccentricitySqToFlattening ( double  epp2)
static
Parameters
[in]epp2= e'' 2 = (a2b2) / (a2 + b2), the third eccentricity squared.
Returns
f = (ab) / a, the flattening.

e'' 2 should lie in (−1, 1). The returned value f lies in (−∞, 1).

◆ FlatteningToThirdEccentricitySq()

static double NETGeographicLib::Ellipsoid::FlatteningToThirdEccentricitySq ( double  f)
static
Parameters
[in]f= (ab) / a, the flattening.
Returns
e'' 2 = (a2b2) / (a2 + b2), the third eccentricity squared.

f should lie in (−∞, 1). The returned value e'' 2 lies in (−1, 1).

Property Documentation

◆ MajorRadius

double NETGeographicLib::Ellipsoid::MajorRadius
get
Returns
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.

Definition at line 91 of file Ellipsoid.h.

◆ MinorRadius

double NETGeographicLib::Ellipsoid::MinorRadius
get
Returns
b the polar semi-axis (meters).

Definition at line 96 of file Ellipsoid.h.

◆ QuarterMeridian

double NETGeographicLib::Ellipsoid::QuarterMeridian
get
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 103 of file Ellipsoid.h.

◆ Area

double NETGeographicLib::Ellipsoid::Area
get
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 110 of file Ellipsoid.h.

◆ Volume

double NETGeographicLib::Ellipsoid::Volume
get
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.h.

◆ Flattening

double NETGeographicLib::Ellipsoid::Flattening
get
Returns
f = (ab) / 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 130 of file Ellipsoid.h.

◆ SecondFlattening

double NETGeographicLib::Ellipsoid::SecondFlattening
get
Returns
f ' = (ab) / b, the second flattening of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 137 of file Ellipsoid.h.

◆ ThirdFlattening

double NETGeographicLib::Ellipsoid::ThirdFlattening
get
Returns
n = (ab) / (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 144 of file Ellipsoid.h.

◆ EccentricitySq

double NETGeographicLib::Ellipsoid::EccentricitySq
get
Returns
e2 = (a2b2) / a2, the eccentricity squared of the ellipsoid. This is zero, positive, or negative for a sphere, oblate ellipsoid, or prolate ellipsoid.

Definition at line 152 of file Ellipsoid.h.

◆ SecondEccentricitySq

double NETGeographicLib::Ellipsoid::SecondEccentricitySq
get
Returns
e' 2 = (a2b2) / 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 160 of file Ellipsoid.h.

◆ ThirdEccentricitySq

double NETGeographicLib::Ellipsoid::ThirdEccentricitySq
get
Returns
e'' 2 = (a2b2) / (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 169 of file Ellipsoid.h.


The documentation for this class was generated from the following file: